mirror of
git://develop.git.wordpress.org/
synced 2025-01-17 21:08:44 +01:00
Customize: Ensure that qunit test enters in expected state and tests wp.customize.dirtyValues
in starter content context.
Fixes regression in [38991]. See #38114. git-svn-id: https://develop.svn.wordpress.org/trunk@38993 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
db66c0d7d2
commit
e0bc1e0c16
@ -561,6 +561,7 @@ jQuery( window ).load( function (){
|
||||
|
||||
module( 'Customize Controls wp.customize.dirtyValues' );
|
||||
test( 'dirtyValues() returns expected values', function() {
|
||||
wp.customize.state( 'changesetStatus' ).set( 'auto-draft' );
|
||||
wp.customize.each( function( setting ) {
|
||||
setting._dirty = false;
|
||||
} );
|
||||
@ -575,6 +576,12 @@ jQuery( window ).load( function (){
|
||||
ok( ! _.isEmpty( wp.customize.dirtyValues() ) );
|
||||
ok( ! _.isEmpty( wp.customize.dirtyValues( { unsaved: true } ) ) );
|
||||
equal( 'Modified', wp.customize.dirtyValues()['fixture-setting'] );
|
||||
|
||||
// When the changeset does not exist, all dirty settings are necessarily unsaved.
|
||||
wp.customize.state( 'changesetStatus' ).set( '' );
|
||||
wp.customize( 'fixture-setting' )._dirty = true;
|
||||
ok( ! _.isEmpty( wp.customize.dirtyValues() ) );
|
||||
ok( ! _.isEmpty( wp.customize.dirtyValues( { unsaved: true } ) ) );
|
||||
} );
|
||||
|
||||
module( 'Customize Controls: wp.customize.requestChangesetUpdate()' );
|
||||
|
Loading…
x
Reference in New Issue
Block a user