Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ESLint: Fix empty toHaveTextContent #45007

Merged
merged 1 commit into from
Oct 17, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions packages/a11y/src/test/clear.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ describe( 'clear', () => {
document.body.appendChild( container2 );

clear();
expect( container1 ).toHaveTextContent( '' );
expect( container2 ).toHaveTextContent( '' );
expect( container1 ).toBeEmptyDOMElement();
expect( container2 ).toBeEmptyDOMElement();
} );
} );
6 changes: 3 additions & 3 deletions packages/a11y/src/test/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ describe( 'speak', () => {
it( 'should set the textcontent of the polite aria-live region', () => {
speak( 'default message' );
expect( containerPolite ).toHaveTextContent( 'default message' );
expect( containerAssertive ).toHaveTextContent( '' );
expect( containerAssertive ).toBeEmptyDOMElement();
expect( clear ).toHaveBeenCalled();
expect( filterMessage ).toHaveBeenCalledWith( 'default message' );
} );
Expand All @@ -52,7 +52,7 @@ describe( 'speak', () => {
describe( 'in assertive mode', () => {
it( 'should set the textcontent of the assertive aria-live region', () => {
speak( 'assertive message', 'assertive' );
expect( containerPolite ).toHaveTextContent( '' );
expect( containerPolite ).toBeEmptyDOMElement();
expect( containerAssertive ).toHaveTextContent(
'assertive message'
);
Expand All @@ -63,7 +63,7 @@ describe( 'speak', () => {
it( 'should set the textcontent of the polite aria-live region', () => {
speak( 'polite message', 'polite' );
expect( containerPolite ).toHaveTextContent( 'polite message' );
expect( containerAssertive ).toHaveTextContent( '' );
expect( containerAssertive ).toBeEmptyDOMElement();
} );
} );

Expand Down