-
Notifications
You must be signed in to change notification settings - Fork 407
upcoming: [UIE-10204] - Allow Simultaneous V1 (Legacy) and V2 (ACLP) Alerting in Linode Edit flow #13455
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
upcoming: [UIE-10204] - Allow Simultaneous V1 (Legacy) and V2 (ACLP) Alerting in Linode Edit flow #13455
Changes from all commits
b38623a
bcbdd81
4b545ce
b9cc270
a566693
db310ef
978f811
ecea0dc
b149c6f
b9200eb
bb12569
43796b1
063cf87
78c44e4
1411620
f6c0c41
4a1bfbc
b933a60
cb532db
885a9bb
1398cb1
c78adb2
9e78fb3
1c9f200
150568f
7b564a0
5d43a62
5039f94
aef1f4f
10c928f
e9cadb7
a90e580
96830de
3b409cd
c158d85
37baf8c
cea9289
fa2a040
72d5e36
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| --- | ||
| "@linode/manager": Upcoming Features | ||
| --- | ||
|
|
||
| Allow simultaneous v1 (Legacy) and v2 (ACLP) alerting in Linode edit flow ([#13455](https://github.com/linode/manager/pull/13455)) |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -108,7 +108,11 @@ describe('Alert Listing Reusable Table for contextual view', () => { | |
|
|
||
| it('Should show confirm dialog on save button click when changes are made', async () => { | ||
| renderWithTheme( | ||
| <AlertInformationActionTable {...props} showConfirmationDialog /> | ||
| <AlertInformationActionTable | ||
| {...props} | ||
| serviceType="dbaas" | ||
| showConfirmationDialog | ||
| /> | ||
| ); | ||
|
|
||
| // First toggle an alert to make changes | ||
|
|
@@ -127,7 +131,9 @@ describe('Alert Listing Reusable Table for contextual view', () => { | |
| }); | ||
|
|
||
| it('Should hide confirm dialog on save button click when changes are made', async () => { | ||
| renderWithTheme(<AlertInformationActionTable {...props} />); | ||
| renderWithTheme( | ||
| <AlertInformationActionTable {...props} serviceType="dbaas" /> | ||
| ); | ||
|
|
||
| // First toggle an alert to make changes | ||
| const alert = alerts[0]; | ||
|
|
@@ -145,14 +151,22 @@ describe('Alert Listing Reusable Table for contextual view', () => { | |
| }); | ||
|
|
||
| it('Should have save button in disabled form when no changes are made', () => { | ||
| renderWithTheme(<AlertInformationActionTable {...props} />); | ||
| renderWithTheme( | ||
| <AlertInformationActionTable {...props} serviceType="dbaas" /> | ||
| ); | ||
|
|
||
| const saveButton = screen.getByTestId('save-alerts'); | ||
| expect(saveButton).toBeDisabled(); | ||
| }); | ||
|
|
||
| it('Should send correct payload to the API when save button is clicked in edit mode', async () => { | ||
| renderWithTheme(<AlertInformationActionTable {...props} alerts={alerts} />); | ||
| renderWithTheme( | ||
| <AlertInformationActionTable | ||
| {...props} | ||
| alerts={alerts} | ||
| serviceType="dbaas" | ||
| /> | ||
| ); | ||
|
|
||
| // Toggle entity-level user alert with ID 2 to enable it | ||
| const userAlertRow = await screen.findByTestId('9'); | ||
|
|
@@ -164,10 +178,38 @@ describe('Alert Listing Reusable Table for contextual view', () => { | |
|
|
||
| // Verify that account and region level alerts are not included in the payload | ||
| expect(mockUpdateAlerts).toHaveBeenCalledWith({ | ||
| alerts: { | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I believe servicePayloadTransformerMap may need an update based on the latest behavior. It might make sense for the CloudPulse team to remove For the |
||
| system_alerts: [1, 2, 3, 4, 5, 6, 7], | ||
| user_alerts: [9], | ||
| }); | ||
| }); | ||
|
|
||
| it('Should not render save button for linode service type', () => { | ||
| // For linode, save is handled by the service owner component (e.g. LinodeAlerts unified save button). | ||
| renderWithTheme(<AlertInformationActionTable {...props} />); // props.serviceType is 'linode' | ||
|
|
||
| expect(screen.queryByTestId('save-alerts')).not.toBeInTheDocument(); | ||
| }); | ||
|
|
||
| it('Should call onToggleAlert with correct payload when a toggle is clicked for linode service type', async () => { | ||
| // Even though the save button is hidden for linode, the toggle still fires onToggleAlert | ||
| // so the service owner can collect the payload for its own save flow. | ||
| const onToggleAlert = vi.fn(); | ||
| renderWithTheme( | ||
| <AlertInformationActionTable {...props} onToggleAlert={onToggleAlert} /> | ||
| ); | ||
|
|
||
| // Toggle entity-level user alert id 9 to enable it | ||
| const userAlertRow = await screen.findByTestId('9'); | ||
| await userEvent.click(within(userAlertRow).getByRole('checkbox')); | ||
|
|
||
| // Raw payload passed to service owner: system_alerts unchanged, user_alerts with the newly toggled alert id 9, | ||
| // and hasUnsavedChanges is true | ||
| expect(onToggleAlert).toHaveBeenCalledWith( | ||
| { | ||
| system_alerts: [1, 2, 3, 4, 5, 6, 7], | ||
| user_alerts: [9], | ||
| }, | ||
| }); | ||
| true // hasUnsavedChanges | ||
| ); | ||
| }); | ||
| }); | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Had to use another service type (
dbaas) instead of the defaultlinodeto make these tests pass since thelinodeservice type does not have a Save button