@wordpress/interface
Version:
Interface module for WordPress. The package contains shared functionality across the modern JavaScript-based WordPress screens.
33 lines (26 loc) • 834 B
JavaScript
/**
* Internal dependencies
*/
import { isModalActive } from '../selectors';
describe( 'selectors', () => {
describe( 'isModalActive', () => {
it( 'returns true if the provided name matches the value in the preferences activeModal property', () => {
const state = {
activeModal: 'test-modal',
};
expect( isModalActive( state, 'test-modal' ) ).toBe( true );
} );
it( 'returns false if the provided name does not match the preferences activeModal property', () => {
const state = {
activeModal: 'something-else',
};
expect( isModalActive( state, 'test-modal' ) ).toBe( false );
} );
it( 'returns false if the preferences activeModal property is null', () => {
const state = {
activeModal: null,
};
expect( isModalActive( state, 'test-modal' ) ).toBe( false );
} );
} );
} );