WordPress.org

Make WordPress Core

Changeset 38993


Ignore:
Timestamp:
10/28/2016 03:28:07 AM (2 years ago)
Author:
westonruter
Message:

Customize: Ensure that qunit test enters in expected state and tests wp.customize.dirtyValues in starter content context.

Fixes regression in [38991].
See #38114.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/qunit/wp-admin/js/customize-controls.js

    r38810 r38993  
    562562    module( 'Customize Controls wp.customize.dirtyValues' );
    563563    test( 'dirtyValues() returns expected values', function() {
     564        wp.customize.state( 'changesetStatus' ).set( 'auto-draft' );
    564565        wp.customize.each( function( setting ) {
    565566            setting._dirty = false;
     
    576577        ok( ! _.isEmpty( wp.customize.dirtyValues( { unsaved: true } ) ) );
    577578        equal( 'Modified', wp.customize.dirtyValues()['fixture-setting'] );
     579
     580        // When the changeset does not exist, all dirty settings are necessarily unsaved.
     581        wp.customize.state( 'changesetStatus' ).set( '' );
     582        wp.customize( 'fixture-setting' )._dirty = true;
     583        ok( ! _.isEmpty( wp.customize.dirtyValues() ) );
     584        ok( ! _.isEmpty( wp.customize.dirtyValues( { unsaved: true } ) ) );
    578585    } );
    579586
Note: See TracChangeset for help on using the changeset viewer.