Skip to content

Commit 37bb294

Browse files
committed
✨ Allow name in test notifications
1 parent d3e6121 commit 37bb294

File tree

2 files changed

+25
-0
lines changed

2 files changed

+25
-0
lines changed

static/app/views/alerts/rules/issue/index.spec.tsx

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,30 @@ describe('IssueRuleEditor', function () {
193193
expect(await screen.findByLabelText('Save Rule')).toBeEnabled();
194194
expect(screen.queryByTestId('project-permission-alert')).not.toBeInTheDocument();
195195
});
196+
197+
it('allows test notifications', async () => {
198+
const {organization, project} = createWrapper();
199+
const mockTestNotification = MockApiClient.addMockResponse({
200+
url: `/projects/${organization.slug}/${project.slug}/rule-actions/`,
201+
method: 'POST',
202+
body: {},
203+
});
204+
await userEvent.click(screen.getByText('Send Test Notification'));
205+
expect(mockTestNotification).toHaveBeenCalledWith(
206+
`/projects/${organization.slug}/${project.slug}/rule-actions/`,
207+
expect.objectContaining({
208+
data: {
209+
actions: [
210+
{
211+
id: 'sentry.rules.actions.notify_event.NotifyEventAction',
212+
name: 'Send a notification (for all legacy integrations)',
213+
},
214+
],
215+
name: 'My alert rule',
216+
},
217+
})
218+
);
219+
});
196220
});
197221

198222
describe('Edit Rule', function () {

static/app/views/alerts/rules/issue/index.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -433,6 +433,7 @@ class IssueRuleEditor extends DeprecatedAsyncComponent<Props, State> {
433433
method: 'POST',
434434
data: {
435435
actions: rule?.actions ?? [],
436+
name: rule?.name,
436437
},
437438
})
438439
.then(() => {

0 commit comments

Comments
 (0)