Skip to content

Commit

Permalink
Merge branch 'main' into 08-15-added_webCompat_as_a_docs_page
Browse files Browse the repository at this point in the history
  • Loading branch information
shakyShane authored Sep 26, 2023
2 parents 5f7f31a + febdbcd commit 5c50bb2
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 12 deletions.
25 changes: 14 additions & 11 deletions integration-test/playwright/page-objects/duckplayer-overlays.js
Original file line number Diff line number Diff line change
Expand Up @@ -167,17 +167,20 @@ export class DuckplayerOverlays {

async userValuesCallIsProxied () {
const calls = await this.page.evaluate(readOutgoingMessages)
expect(calls).toMatchObject([
{
payload: {
context: this.messagingContext,
featureName: 'duckPlayer',
params: {},
method: 'getUserValues',
id: 'getUserValues.response'
}
}
])
const message = calls[0]
const { id, ...rest } = message.payload

// just a sanity-check to ensure a none-empty string was used as the id
expect(typeof id).toBe('string')
expect(id.length).toBeGreaterThan(10)

// assert on the payload, minus the ID
expect(rest).toMatchObject({
context: this.messagingContext,
featureName: 'duckPlayer',
params: {},
method: 'getUserValues'
})
}

async overlayBlocksVideo () {
Expand Down
2 changes: 1 addition & 1 deletion packages/messaging/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ export class Messaging {
* @return {Promise<any>}
*/
request (name, data = {}) {
const id = name + '.response'
const id = globalThis?.crypto?.randomUUID() || name + '.response'
const message = new RequestMessage({
context: this.messagingContext.context,
featureName: this.messagingContext.featureName,
Expand Down

0 comments on commit 5c50bb2

Please sign in to comment.