Skip to content

Commit bb9eaa5

Browse files
Use new flag
Signed-off-by: Adhitya Mamallan <adhitya.mamallan@uber.com>
1 parent 416651b commit bb9eaa5

File tree

4 files changed

+20
-20
lines changed

4 files changed

+20
-20
lines changed

src/views/workflow-history-v2/workflow-history-switch-to-v1-button/__tests__/workflow-history-switch-to-v1-button.test.tsx

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -51,28 +51,28 @@ describe(WorkflowHistorySwitchToV1Button.name, () => {
5151
});
5252
});
5353

54-
it('should call setIsWorkflowHistoryV2Enabled with false when button is clicked', async () => {
55-
const { user, mockSetIsWorkflowHistoryV2Enabled } = setup({
54+
it('should call setIsWorkflowHistoryV2Selected with false when button is clicked', async () => {
55+
const { user, mockSetIsWorkflowHistoryV2Selected } = setup({
5656
configValue: 'OPT_OUT',
5757
});
5858

5959
const button = await screen.findByText('Switch to the legacy History view');
6060
await user.click(button);
6161

62-
expect(mockSetIsWorkflowHistoryV2Enabled).toHaveBeenCalledTimes(1);
63-
expect(mockSetIsWorkflowHistoryV2Enabled).toHaveBeenCalledWith(false);
62+
expect(mockSetIsWorkflowHistoryV2Selected).toHaveBeenCalledTimes(1);
63+
expect(mockSetIsWorkflowHistoryV2Selected).toHaveBeenCalledWith(false);
6464
});
6565
});
6666

6767
function setup({ configValue }: { configValue: string }) {
6868
const user = userEvent.setup();
69-
const mockSetIsWorkflowHistoryV2Enabled = jest.fn();
69+
const mockSetIsWorkflowHistoryV2Selected = jest.fn();
7070

7171
const contextValue = {
7272
ungroupedViewUserPreference: null,
7373
setUngroupedViewUserPreference: jest.fn(),
74-
isWorkflowHistoryV2Enabled: true,
75-
setIsWorkflowHistoryV2Enabled: mockSetIsWorkflowHistoryV2Enabled,
74+
isWorkflowHistoryV2Selected: true,
75+
setIsWorkflowHistoryV2Selected: mockSetIsWorkflowHistoryV2Selected,
7676
};
7777

7878
const renderResult = render(
@@ -95,7 +95,7 @@ function setup({ configValue }: { configValue: string }) {
9595

9696
return {
9797
user,
98-
mockSetIsWorkflowHistoryV2Enabled,
98+
mockSetIsWorkflowHistoryV2Selected,
9999
...renderResult,
100100
};
101101
}

src/views/workflow-history-v2/workflow-history-switch-to-v1-button/workflow-history-switch-to-v1-button.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ export default function WorkflowHistorySwitchToV1Button() {
1111
'HISTORY_PAGE_V2_ENABLED'
1212
);
1313

14-
const { setIsWorkflowHistoryV2Enabled } = useContext(WorkflowHistoryContext);
14+
const { setIsWorkflowHistoryV2Selected } = useContext(WorkflowHistoryContext);
1515

1616
if (historyPageV2Config === 'DISABLED' || historyPageV2Config === 'ENABLED') {
1717
return null;
@@ -21,7 +21,7 @@ export default function WorkflowHistorySwitchToV1Button() {
2121
<WorkflowHistoryViewToggleButton
2222
kind="secondary"
2323
label="Switch to the legacy History view"
24-
onClick={() => setIsWorkflowHistoryV2Enabled(false)}
24+
onClick={() => setIsWorkflowHistoryV2Selected(false)}
2525
tooltipContent={workflowHistorySwitchToV1ButtonTooltipContentConfig}
2626
/>
2727
);

src/views/workflow-history/workflow-history-switch-to-v2-button/__tests__/workflow-history-switch-to-v2-button.test.tsx

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -50,28 +50,28 @@ describe(WorkflowHistorySwitchToV2Button.name, () => {
5050
});
5151
});
5252

53-
it('should call setIsWorkflowHistoryV2Enabled with true when button is clicked', async () => {
54-
const { user, mockSetIsWorkflowHistoryV2Enabled } = setup({
53+
it('should call setIsWorkflowHistoryV2Selected with true when button is clicked', async () => {
54+
const { user, mockSetIsWorkflowHistoryV2Selected } = setup({
5555
configValue: 'OPT_OUT',
5656
});
5757

5858
const button = await screen.findByText('Switch to the new History view');
5959
await user.click(button);
6060

61-
expect(mockSetIsWorkflowHistoryV2Enabled).toHaveBeenCalledTimes(1);
62-
expect(mockSetIsWorkflowHistoryV2Enabled).toHaveBeenCalledWith(true);
61+
expect(mockSetIsWorkflowHistoryV2Selected).toHaveBeenCalledTimes(1);
62+
expect(mockSetIsWorkflowHistoryV2Selected).toHaveBeenCalledWith(true);
6363
});
6464
});
6565

6666
function setup({ configValue }: { configValue: string }) {
6767
const user = userEvent.setup();
68-
const mockSetIsWorkflowHistoryV2Enabled = jest.fn();
68+
const mockSetIsWorkflowHistoryV2Selected = jest.fn();
6969

7070
const contextValue = {
7171
ungroupedViewUserPreference: null,
7272
setUngroupedViewUserPreference: jest.fn(),
73-
isWorkflowHistoryV2Enabled: false,
74-
setIsWorkflowHistoryV2Enabled: mockSetIsWorkflowHistoryV2Enabled,
73+
isWorkflowHistoryV2Selected: false,
74+
setIsWorkflowHistoryV2Selected: mockSetIsWorkflowHistoryV2Selected,
7575
};
7676

7777
const renderResult = render(
@@ -94,7 +94,7 @@ function setup({ configValue }: { configValue: string }) {
9494

9595
return {
9696
user,
97-
mockSetIsWorkflowHistoryV2Enabled,
97+
mockSetIsWorkflowHistoryV2Selected,
9898
...renderResult,
9999
};
100100
}

src/views/workflow-history/workflow-history-switch-to-v2-button/workflow-history-switch-to-v2-button.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ export default function WorkflowHistorySwitchToV2Button() {
1111
'HISTORY_PAGE_V2_ENABLED'
1212
);
1313

14-
const { setIsWorkflowHistoryV2Enabled } = useContext(WorkflowHistoryContext);
14+
const { setIsWorkflowHistoryV2Selected } = useContext(WorkflowHistoryContext);
1515

1616
if (historyPageV2Config === 'DISABLED' || historyPageV2Config === 'ENABLED') {
1717
return null;
@@ -21,7 +21,7 @@ export default function WorkflowHistorySwitchToV2Button() {
2121
<WorkflowHistoryViewToggleButton
2222
kind="primary"
2323
label="Switch to the new History view"
24-
onClick={() => setIsWorkflowHistoryV2Enabled(true)}
24+
onClick={() => setIsWorkflowHistoryV2Selected(true)}
2525
tooltipContent={workflowHistorySwitchToV2ButtonTooltipContentConfig}
2626
/>
2727
);

0 commit comments

Comments
 (0)