diff --git a/packages/components/src/date-time/time/test/index.tsx b/packages/components/src/date-time/time/test/index.tsx index 3883c74c94e777..4b22cd232baf0e 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', () => {