-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Re-insert redirectmap functionality, which should be there according to docs - add redirectmap tests for localstorage and sessionstorage according to docs - fix/improve custom rpc test which did hang/fail, by proxying to main rpc, but detect that custom rpc is used - caching of CI dependencies - update Near Social VM to 2.6.1
- Loading branch information
1 parent
4748c8e
commit c21caf8
Showing
7 changed files
with
223 additions
and
93 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
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 |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{ | ||
"cookies": [], | ||
"origins": [ | ||
{ | ||
"origin": "http://localhost:3000", | ||
"localStorage": [ | ||
{ | ||
"name": "flags", | ||
"value": "{\"bosLoaderUrl\":\"http://localhost:3030\"}" | ||
} | ||
] | ||
} | ||
], | ||
"sessionStorage": [] | ||
} |
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,47 @@ | ||
import { test, describe, expect } from '@playwright/test'; | ||
|
||
describe("bos-loader-url", () => { | ||
test.use({ | ||
storageState: "playwright-tests/storage-states/bos-loader-url.json" | ||
}); | ||
test("Should be possible to provide a redirectmap through flags in localStorage", async ({ | ||
page, | ||
}) => { | ||
await page.route("http://localhost:3030", async (route) => { | ||
await route.fulfill({ | ||
body: JSON.stringify( | ||
{ | ||
components: | ||
{ | ||
"something.near/widget/testcomponent": | ||
{ "code": "return 'I come from a redirect map pointed to by flags in localStorage';" } | ||
} | ||
} | ||
) | ||
}); | ||
}); | ||
await page.goto("/something.near/widget/testcomponent"); | ||
await expect(page.getByText('I come from a redirect map pointed to by flags in localStorage')).toBeVisible(); | ||
}); | ||
}); | ||
|
||
describe("session-storage", () => { | ||
test("Should be possible to provide a redirectmap through session storage key", async ({ | ||
page, | ||
}) => { | ||
await page.context().addInitScript(() => { | ||
console.log('init script'); | ||
sessionStorage.setItem('nearSocialVMredirectMap', JSON.stringify( | ||
{ | ||
"something.near/widget/testcomponent": | ||
{ "code": "return 'I come from a redirect map from session storage';" } | ||
} | ||
)); | ||
}) | ||
await page.goto("/something.near/widget/testcomponent"); | ||
await page.evaluate(() => { | ||
console.log(JSON.parse(sessionStorage.getItem("nearSocialVMredirectMap"))) | ||
}) | ||
await expect(await page.getByText('I come from a redirect map from session storage')).toBeVisible(); | ||
}); | ||
}); |
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.