|
@@ -1,5 +1,6 @@
|
|
import {browserHistory, PlainRoute} from 'react-router';
|
|
import {browserHistory, PlainRoute} from 'react-router';
|
|
import selectEvent from 'react-select-event';
|
|
import selectEvent from 'react-select-event';
|
|
|
|
+import moment from 'moment';
|
|
|
|
|
|
import {initializeOrg} from 'sentry-test/initializeOrg';
|
|
import {initializeOrg} from 'sentry-test/initializeOrg';
|
|
import {
|
|
import {
|
|
@@ -342,6 +343,27 @@ describe('IssueRuleEditor', function () {
|
|
screen.getByText('Post to a Threads channel with these')
|
|
screen.getByText('Post to a Threads channel with these')
|
|
).toBeInTheDocument();
|
|
).toBeInTheDocument();
|
|
});
|
|
});
|
|
|
|
+
|
|
|
|
+ it('opts out of the alert being disabled', async function () {
|
|
|
|
+ MockApiClient.addMockResponse({
|
|
|
|
+ url: '/projects/org-slug/project-slug/rules/1/',
|
|
|
|
+ body: TestStubs.ProjectAlertRule({
|
|
|
|
+ status: 'disabled',
|
|
|
|
+ disabledDate: moment().add(1, 'day').toISOString(),
|
|
|
|
+ }),
|
|
|
|
+ });
|
|
|
|
+ createWrapper();
|
|
|
|
+ await userEvent.click(screen.getByText('Save Rule'));
|
|
|
|
+
|
|
|
|
+ await waitFor(() =>
|
|
|
|
+ expect(mock).toHaveBeenCalledWith(
|
|
|
|
+ endpoint,
|
|
|
|
+ expect.objectContaining({
|
|
|
|
+ data: expect.objectContaining({optOutEdit: true}),
|
|
|
|
+ })
|
|
|
|
+ )
|
|
|
|
+ );
|
|
|
|
+ });
|
|
});
|
|
});
|
|
|
|
|
|
describe('Edit Rule: Slack Channel Look Up', function () {
|
|
describe('Edit Rule: Slack Channel Look Up', function () {
|