From a3ec098b01a8fbd0665b548270bb33c062503f96 Mon Sep 17 00:00:00 2001 From: Marin Atanasov <8436925+tyxla@users.noreply.github.com> Date: Thu, 13 Oct 2022 07:21:01 +0200 Subject: [PATCH] ESLint: Fix jest-dom/prefer-to-have-class rule violations (#44902) --- packages/components/src/date-time/time/test/index.tsx | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/packages/components/src/date-time/time/test/index.tsx b/packages/components/src/date-time/time/test/index.tsx index 3883c74c94e77..4b22cd232baf0 100644 --- a/packages/components/src/date-time/time/test/index.tsx +++ b/packages/components/src/date-time/time/test/index.tsx @@ -303,12 +303,8 @@ describe( 'TimePicker', () => { * This is not ideal, but best of we can do for now until we refactor * AM/PM into accessible elements, like radio buttons. */ - expect( - screen.getByText( 'AM' ).classList.contains( 'is-primary' ) - ).toBe( false ); - expect( - screen.getByText( 'PM' ).classList.contains( 'is-primary' ) - ).toBe( true ); + expect( screen.getByText( 'AM' ) ).not.toHaveClass( 'is-primary' ); + expect( screen.getByText( 'PM' ) ).toHaveClass( 'is-primary' ); } ); it( 'should have different layouts/orders for 12/24 hour formats', () => {