fix: Cancel alert is not appearing to all native filters modal fields (#15925)

This commit is contained in:
Michael S. Molina
2021-07-30 11:59:36 -03:00
committed by GitHub
parent eb78f4332f
commit cc704dd53a
5 changed files with 48 additions and 50 deletions

View File

@@ -119,22 +119,12 @@ describe('FiltersConfigModal', () => {
expect(onCancel.mock.calls).toHaveLength(1);
});
it('shows correct alert message for an unsaved filter', async () => {
it('shows correct alert message for unsaved filters', async () => {
addFilter();
await clickCancel();
expect(onCancel.mock.calls).toHaveLength(0);
expect(wrapper.find(Alert).text()).toContain(
'Are you sure you want to cancel? "New filter" will not be saved.',
);
});
it('shows correct alert message for 2 unsaved filters', async () => {
addFilter();
addFilter();
await clickCancel();
expect(onCancel.mock.calls).toHaveLength(0);
expect(wrapper.find(Alert).text()).toContain(
'Are you sure you want to cancel? "New filter" and "New filter" will not be saved.',
'There are unsaved changes.',
);
});
});