Skip to content

Commit

Permalink
test: resolve issue with setting navigator language
Browse files Browse the repository at this point in the history
  • Loading branch information
tristan-greffe committed Mar 28, 2024
1 parent f430176 commit 6fa2f4c
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 0 deletions.
10 changes: 10 additions & 0 deletions test/app.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,16 @@ describe(`suite:${suite}`, () => {
}
})
page = await runner.start()
await page.evaluate(() => {
if ('serviceWorker' in navigator && navigator.serviceWorker.controller) {
navigator.serviceWorker.controller.postMessage({ type: 'SKIP_WAITING' })
}
Object.defineProperty(navigator, 'language', {
get: function() {
return 'fr'
}
})
})
await core.goToRegisterScreen(page)
user = {
name: 'kalisio',
Expand Down
10 changes: 10 additions & 0 deletions test/layout.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,16 @@ describe(`suite:${suite}`, () => {
}
})
page = await runner.start()
await page.evaluate(() => {
if ('serviceWorker' in navigator && navigator.serviceWorker.controller) {
navigator.serviceWorker.controller.postMessage({ type: 'SKIP_WAITING' })
}
Object.defineProperty(navigator, 'language', {
get: function() {
return 'fr'
}
})
})
user = {
email: '[email protected]',
password: 'Pass;word1'
Expand Down
10 changes: 10 additions & 0 deletions test/misc.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,16 @@ describe(`suite:${suite}`, () => {
}
})
page = await runner.start()
await page.evaluate(() => {
if ('serviceWorker' in navigator && navigator.serviceWorker.controller) {
navigator.serviceWorker.controller.postMessage({ type: 'SKIP_WAITING' })
}
Object.defineProperty(navigator, 'language', {
get: function() {
return 'fr'
}
})
})
user = {
email: '[email protected]',
password: 'Pass;word1'
Expand Down
10 changes: 10 additions & 0 deletions test/webpush.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,16 @@ describe(`suite:${suite}`, () => {
}
})
page = await runner.start()
await page.evaluate(() => {
if ('serviceWorker' in navigator && navigator.serviceWorker.controller) {
navigator.serviceWorker.controller.postMessage({ type: 'SKIP_WAITING' })
}
Object.defineProperty(navigator, 'language', {
get: function() {
return 'fr'
}
})
})
user = {
email: '[email protected]',
password: 'Pass;word1'
Expand Down

0 comments on commit 6fa2f4c

Please sign in to comment.