Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Update unit test
  • Loading branch information
talldan committed Aug 24, 2021
commit d2c6da4845003fe5bd72e0f80f141b08609b5eaf
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ exports[`EnableCustomFieldsOption renders a checked checkbox and a confirmation
}

<div
className="edit-post-preferences-modal__option"
className="interface-preferences-modal-toggle"
>
<div
className="components-base-control components-toggle-control emotion-0 emotion-1"
Expand Down Expand Up @@ -78,7 +78,7 @@ exports[`EnableCustomFieldsOption renders a checked checkbox when custom fields
}

<div
className="edit-post-preferences-modal__option"
className="interface-preferences-modal-toggle"
>
<div
className="components-base-control components-toggle-control emotion-0 emotion-1"
Expand Down Expand Up @@ -127,7 +127,7 @@ exports[`EnableCustomFieldsOption renders an unchecked checkbox and a confirmati
}

<div
className="edit-post-preferences-modal__option"
className="interface-preferences-modal-toggle"
>
<div
className="components-base-control components-toggle-control emotion-0 emotion-1"
Expand Down Expand Up @@ -190,7 +190,7 @@ exports[`EnableCustomFieldsOption renders an unchecked checkbox when custom fiel
}

<div
className="edit-post-preferences-modal__option"
className="interface-preferences-modal-toggle"
>
<div
className="components-base-control components-toggle-control emotion-0 emotion-1"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { default as TestRenderer, act } from 'react-test-renderer';
* WordPress dependencies
*/
import { Button } from '@wordpress/components';
import { PreferencesModalToggle } from '@wordpress/interface';

/**
* Internal dependencies
Expand All @@ -15,7 +16,6 @@ import {
EnableCustomFieldsOption,
CustomFieldsConfirmation,
} from '../enable-custom-fields';
import BaseOption from '../base';

describe( 'EnableCustomFieldsOption', () => {
it( 'renders a checked checkbox when custom fields are enabled', () => {
Expand All @@ -37,7 +37,9 @@ describe( 'EnableCustomFieldsOption', () => {
<EnableCustomFieldsOption areCustomFieldsEnabled />
);
act( () => {
renderer.root.findByType( BaseOption ).props.onChange( false );
renderer.root
.findByType( PreferencesModalToggle )
.props.onChange( false );
} );
expect( renderer ).toMatchSnapshot();
} );
Expand All @@ -47,7 +49,9 @@ describe( 'EnableCustomFieldsOption', () => {
<EnableCustomFieldsOption areCustomFieldsEnabled={ false } />
);
act( () => {
renderer.root.findByType( BaseOption ).props.onChange( true );
renderer.root
.findByType( PreferencesModalToggle )
.props.onChange( true );
} );
expect( renderer ).toMatchSnapshot();
} );
Expand Down