-
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.
* Add prettier * Run format scripts * Add script to run linter * Fix scripts + add format step in action * Bump version
- Loading branch information
Showing
19 changed files
with
225 additions
and
156 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 |
---|---|---|
@@ -1,8 +1,8 @@ | ||
{ | ||
"customizations": { | ||
"vscode": { | ||
"extensions": ["github.vscode-github-actions", "ms-playwright.playwright"] | ||
} | ||
}, | ||
"postCreateCommand": "./.devcontainer/post-create.sh" | ||
} | ||
"customizations": { | ||
"vscode": { | ||
"extensions": ["github.vscode-github-actions", "ms-playwright.playwright"] | ||
} | ||
}, | ||
"postCreateCommand": "./.devcontainer/post-create.sh" | ||
} |
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 |
---|---|---|
|
@@ -7,5 +7,3 @@ | |
tasks: | ||
- init: yarn install && yarn run build | ||
command: yarn run start | ||
|
||
|
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 @@ | ||
dist | ||
node_modules | ||
public | ||
test-results |
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,6 @@ | ||
{ | ||
"trailingComma": "es5", | ||
"tabWidth": 2, | ||
"semi": true, | ||
"singleQuote": false | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,4 +12,4 @@ | |
} | ||
], | ||
"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 |
---|---|---|
@@ -1,47 +1,55 @@ | ||
import { test, describe, expect } from '@playwright/test'; | ||
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(); | ||
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"))) | ||
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 expect(await page.getByText('I come from a redirect map from session storage')).toBeVisible(); | ||
); | ||
}); | ||
}); | ||
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.