-
Notifications
You must be signed in to change notification settings - Fork 69
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add global theme support flag (#9276)
- Loading branch information
Showing
16 changed files
with
255 additions
and
100 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
Significance: patch | ||
Type: add | ||
|
||
Add WooPay global theme support flag |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -78,10 +78,10 @@ describe( 'WCPayAPI', () => { | |
getConfig.mockImplementation( ( key ) => { | ||
const mockProperties = { | ||
initWooPayNonce: 'foo', | ||
appearance: mockAppearance, | ||
order_id: 1, | ||
key: 'testkey', | ||
billing_email: '[email protected]', | ||
isWooPayGlobalThemeSupportEnabled: true, | ||
}; | ||
return mockProperties[ key ]; | ||
} ); | ||
|
@@ -114,4 +114,25 @@ describe( 'WCPayAPI', () => { | |
foo: 'bar', | ||
} ); | ||
} ); | ||
|
||
test( 'WooPay should not support global theme styles', async () => { | ||
buildAjaxURL.mockReturnValue( 'https://example.org/' ); | ||
getConfig.mockImplementation( ( key ) => { | ||
const mockProperties = { | ||
initWooPayNonce: 'foo', | ||
isWooPayGlobalThemeSupportEnabled: false, | ||
}; | ||
return mockProperties[ key ]; | ||
} ); | ||
|
||
const api = new WCPayAPI( {}, request ); | ||
await api.initWooPay( '[email protected]', 'qwerty123' ); | ||
|
||
expect( request ).toHaveBeenLastCalledWith( 'https://example.org/', { | ||
_wpnonce: 'foo', | ||
appearance: null, | ||
email: '[email protected]', | ||
user_session: 'qwerty123', | ||
} ); | ||
} ); | ||
} ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.