From b832f712f59e60f9c775732873451b318c4076c8 Mon Sep 17 00:00:00 2001 From: Zacqary Xeper Date: Wed, 14 Jun 2023 17:16:40 -0500 Subject: [PATCH] Fix jest --- .../rule_quick_edit_buttons.test.tsx | 38 +++---------------- 1 file changed, 5 insertions(+), 33 deletions(-) diff --git a/x-pack/plugins/triggers_actions_ui/public/application/sections/common/components/rule_quick_edit_buttons.test.tsx b/x-pack/plugins/triggers_actions_ui/public/application/sections/common/components/rule_quick_edit_buttons.test.tsx index 4967f23f658a41..f03ddfcf970960 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/sections/common/components/rule_quick_edit_buttons.test.tsx +++ b/x-pack/plugins/triggers_actions_ui/public/application/sections/common/components/rule_quick_edit_buttons.test.tsx @@ -77,7 +77,7 @@ describe('rule_quick_edit_buttons', () => { expect(wrapper.find('[data-test-subj="bulkDisable"]').exists()).toBeTruthy(); }); - it('disables the disable/enable/delete bulk actions if in select all mode', async () => { + it('removes the snooze bulk actions if in select all mode', async () => { const mockRule: RuleTableItem = { id: '1', enabled: true, @@ -99,14 +99,10 @@ describe('rule_quick_edit_buttons', () => { expect(wrapper.find('[data-test-subj="bulkEnable"]').first().prop('isDisabled')).toBeFalsy(); expect(wrapper.find('[data-test-subj="bulkDelete"]').first().prop('isDisabled')).toBeFalsy(); expect(wrapper.find('[data-test-subj="updateAPIKeys"]').first().prop('isDisabled')).toBeFalsy(); - expect(wrapper.find('[data-test-subj="bulkSnooze"]').first().prop('isDisabled')).toBeFalsy(); - expect(wrapper.find('[data-test-subj="bulkUnsnooze"]').first().prop('isDisabled')).toBeFalsy(); - expect( - wrapper.find('[data-test-subj="bulkSnoozeSchedule"]').first().prop('isDisabled') - ).toBeFalsy(); - expect( - wrapper.find('[data-test-subj="bulkRemoveSnoozeSchedule"]').first().prop('isDisabled') - ).toBeFalsy(); + expect(wrapper.find('[data-test-subj="bulkSnooze"]').exists()).toBeFalsy(); + expect(wrapper.find('[data-test-subj="bulkUnsnooze"]').exists()).toBeFalsy(); + expect(wrapper.find('[data-test-subj="bulkSnoozeSchedule"]').exists()).toBeFalsy(); + expect(wrapper.find('[data-test-subj="bulkRemoveSnoozeSchedule"]').exists()).toBeFalsy(); }); it('properly sets rules or filters to delete when not selecting all', async () => { @@ -132,28 +128,4 @@ describe('rule_quick_edit_buttons', () => { wrapper.find('[data-test-subj="bulkSnooze"]').first().simulate('click'); expect(updateRulesToBulkEdit).toHaveBeenCalledTimes(1); }); - - it('properly sets rules or filters to delete when selecting all', async () => { - const mockRule: RuleTableItem = { - id: '1', - enabled: true, - enabledInLicense: true, - } as RuleTableItem; - - const wrapper = mountWithIntl( - null} - selectedItems={[mockRule]} - onPerformingAction={() => {}} - onActionPerformed={() => {}} - onEnable={async () => {}} - onDisable={async () => {}} - updateRulesToBulkEdit={updateRulesToBulkEdit} - /> - ); - - wrapper.find('[data-test-subj="bulkSnooze"]').first().simulate('click'); - expect(updateRulesToBulkEdit).toHaveBeenCalledTimes(1); - }); });