mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-06-28 22:30:04 +00:00
Administration: Adjust the "No private directive present in cache control when user not logged in" test so the assertions won't fail if the headers don't contain a cache-control key at all.
Props joemcgill Fixes #21938 git-svn-id: https://develop.svn.wordpress.org/trunk@56134 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -20,20 +20,20 @@ describe( 'Cache Control header directives', () => {
|
||||
await logout();
|
||||
|
||||
const response = await page.goto( createURL( '/hello-world/' ) );
|
||||
const cacheControl = response.headers();
|
||||
const responseHeaders = response.headers();
|
||||
|
||||
expect( cacheControl[ 'cache-control' ] ).not.toContain( 'no-store' );
|
||||
expect( cacheControl[ 'cache-control' ] ).not.toContain( 'private' );
|
||||
expect( responseHeaders ).toEqual( expect.not.objectContaining( { "cache-control": "no-store" } ) );
|
||||
expect( responseHeaders ).toEqual( expect.not.objectContaining( { "cache-control": "private" } ) );
|
||||
} );
|
||||
|
||||
it( 'Private directive header present in cache control when logged in.', async () => {
|
||||
await visitAdminPage( '/wp-admin' );
|
||||
|
||||
const response = await page.goto( createURL( '/wp-admin' ) );
|
||||
const cacheControl = response.headers();
|
||||
const responseHeaders = response.headers();
|
||||
|
||||
expect( cacheControl[ 'cache-control' ] ).toContain( 'no-store' );
|
||||
expect( cacheControl[ 'cache-control' ] ).toContain( 'private' );
|
||||
expect( responseHeaders[ 'cache-control' ] ).toContain( 'no-store' );
|
||||
expect( responseHeaders[ 'cache-control' ] ).toContain( 'private' );
|
||||
} );
|
||||
|
||||
} );
|
||||
|
||||
Reference in New Issue
Block a user