diff --git a/js_modules/dagster-ui/packages/ui-core/src/ticks/DryRunRequestTable.tsx b/js_modules/dagster-ui/packages/ui-core/src/ticks/DryRunRequestTable.tsx
index ca8082e8561fb..b9859d06be68a 100644
--- a/js_modules/dagster-ui/packages/ui-core/src/ticks/DryRunRequestTable.tsx
+++ b/js_modules/dagster-ui/packages/ui-core/src/ticks/DryRunRequestTable.tsx
@@ -52,6 +52,7 @@ export const RunRequestTable = ({runRequests, isJob, repoAddress, mode, jobName}
{
setSelectedRequest(request);
setVisibleDialog('config');
@@ -91,10 +92,14 @@ export const RunRequestTable = ({runRequests, isJob, repoAddress, mode, jobName}
);
};
-function PreviewButton({onClick}: {onClick: () => void}) {
+function PreviewButton({request, onClick}: {request: RunRequestFragment; onClick: () => void}) {
return (
- } onClick={onClick} />
+ }
+ onClick={onClick}
+ data-testid={testId(`preview-${request.runKey || ''}`)}
+ />
);
}
diff --git a/js_modules/dagster-ui/packages/ui-core/src/ticks/__tests__/DryRunRequestTable.test.tsx b/js_modules/dagster-ui/packages/ui-core/src/ticks/__tests__/DryRunRequestTable.test.tsx
index f8f2a760ec648..a1985435b0db5 100644
--- a/js_modules/dagster-ui/packages/ui-core/src/ticks/__tests__/DryRunRequestTable.test.tsx
+++ b/js_modules/dagster-ui/packages/ui-core/src/ticks/__tests__/DryRunRequestTable.test.tsx
@@ -1,4 +1,4 @@
-import {render, screen} from '@testing-library/react';
+import {render, screen, waitFor} from '@testing-library/react';
import {BrowserRouter} from 'react-router-dom';
import {RunRequestTable} from '../DryRunRequestTable';
@@ -9,6 +9,10 @@ jest.mock('../../workspace/WorkspaceContext/util', () => ({
useRepository: jest.fn(() => null),
}));
+jest.mock('../../runs/RunConfigDialog', () => ({
+ RunConfigDialog: () => RunConfigDialog ,
+}));
+
function TestComponent() {
return (
@@ -31,10 +35,19 @@ describe('RunRequestTableTest', () => {
render();
runRequests.forEach((req) => {
- req.tags.forEach(({key, value}) => {
- expect(screen.getByText(`${key}: ${value}`)).toBeVisible();
- });
expect(screen.getByTestId(req.runKey!)).toBeVisible();
});
});
+
+ it('renders preview button and opens dialog on click', async () => {
+ render();
+
+ const previewButton = screen.getByTestId(`preview-${runRequests[0]!.runKey || ''}`);
+ expect(previewButton).toBeVisible();
+ previewButton.click();
+
+ await waitFor(() => {
+ expect(screen.getByText(/RunConfigDialog/i)).toBeVisible();
+ });
+ });
});
diff --git a/js_modules/dagster-ui/packages/ui-core/src/ticks/__tests__/EvaluateScheduleDialog.test.tsx b/js_modules/dagster-ui/packages/ui-core/src/ticks/__tests__/EvaluateScheduleDialog.test.tsx
index 34e6a802718a3..944295f2f90e0 100644
--- a/js_modules/dagster-ui/packages/ui-core/src/ticks/__tests__/EvaluateScheduleDialog.test.tsx
+++ b/js_modules/dagster-ui/packages/ui-core/src/ticks/__tests__/EvaluateScheduleDialog.test.tsx
@@ -84,4 +84,42 @@ describe('EvaluateScheduleTest', () => {
expect(screen.getByText('Skipped')).toBeVisible();
});
});
+
+ it('allows you to test again', async () => {
+ render();
+ const selectButton = await screen.findByTestId('tick-selection');
+ await userEvent.click(selectButton);
+ await waitFor(() => {
+ expect(screen.getByTestId('tick-5')).toBeVisible();
+ });
+ await userEvent.click(screen.getByTestId('tick-5'));
+ await userEvent.click(screen.getByTestId('continue'));
+ await waitFor(() => {
+ expect(screen.getByText('Skipped')).toBeVisible();
+ });
+ await userEvent.click(screen.getByTestId('try-again'));
+ expect(screen.queryByText('Failed')).toBe(null);
+ expect(screen.queryByText('Skipped')).toBe(null);
+ });
+
+ it('launches all runs', async () => {
+ render();
+ const selectButton = await screen.findByTestId('tick-selection');
+ await userEvent.click(selectButton);
+ await waitFor(() => {
+ expect(screen.getByTestId('tick-5')).toBeVisible();
+ });
+ await userEvent.click(screen.getByTestId('tick-5'));
+ await userEvent.click(screen.getByTestId('continue'));
+ await waitFor(() => {
+ expect(screen.getByText(/1\s+run request/i)).toBeVisible();
+ expect(screen.getByTestId('launch-all')).not.toBeDisabled();
+ });
+
+ userEvent.click(screen.getByTestId('launch-all'));
+
+ await waitFor(() => {
+ expect(screen.getByText(/Launching runs/i)).toBeVisible();
+ });
+ }, 10000);
});
diff --git a/js_modules/dagster-ui/packages/ui-core/src/ticks/__tests__/SensorDryRunDialog.test.tsx b/js_modules/dagster-ui/packages/ui-core/src/ticks/__tests__/SensorDryRunDialog.test.tsx
index 4e23fef7c256c..2051f5f6e3acb 100644
--- a/js_modules/dagster-ui/packages/ui-core/src/ticks/__tests__/SensorDryRunDialog.test.tsx
+++ b/js_modules/dagster-ui/packages/ui-core/src/ticks/__tests__/SensorDryRunDialog.test.tsx
@@ -57,6 +57,16 @@ describe('SensorDryRunTest', () => {
});
});
+ it('renders skip reason', async () => {
+ render();
+ const cursorInput = await screen.findByTestId('cursor-input');
+ await userEvent.type(cursorInput, 'testing123');
+ await userEvent.click(screen.getByTestId('continue'));
+ await waitFor(() => {
+ expect(screen.getByText('Skipped')).toBeVisible();
+ });
+ });
+
it('allows you to test again', async () => {
render();
const cursorInput = await screen.findByTestId('cursor-input');
@@ -72,13 +82,25 @@ describe('SensorDryRunTest', () => {
expect(screen.getByTestId('cursor-input')).toBeVisible();
});
- it('renders skip reason', async () => {
- render();
+ it('launches all runs', async () => {
+ render();
const cursorInput = await screen.findByTestId('cursor-input');
await userEvent.type(cursorInput, 'testing123');
await userEvent.click(screen.getByTestId('continue'));
await waitFor(() => {
- expect(screen.getByText('Skipped')).toBeVisible();
+ expect(screen.getByText(/3\srun requests/g)).toBeVisible();
+ expect(screen.queryByText('Skipped')).toBe(null);
+ expect(screen.queryByText('Failed')).toBe(null);
});
- });
+
+ await waitFor(() => {
+ expect(screen.getByTestId('launch-all')).not.toBeDisabled();
+ });
+
+ userEvent.click(screen.getByTestId('launch-all'));
+
+ await waitFor(() => {
+ expect(screen.getByText(/Launching runs/i)).toBeVisible();
+ });
+ }, 10000);
});
|