mirror of
https://seed.radicle.dev/rad:z4V1sjrXqjvFdnCUbxPFqd5p4DtH5.git
synced 2026-11-29 02:00:31 +08:00
Extract custom app config in tests
Signed-off-by: Rūdolfs Ošiņš <rudolfs@osins.org>
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { test, expect } from "@tests/support/fixtures.js";
|
||||
import { test, expect, appConfigWithFixture } from "@tests/support/fixtures.js";
|
||||
import {
|
||||
expectBackAndForwardNavigationWorks,
|
||||
expectUrlPersistsReload,
|
||||
@@ -11,26 +11,7 @@ test.beforeEach(async ({ page }) => {
|
||||
});
|
||||
|
||||
test("navigate between landing and project page", async ({ page }) => {
|
||||
await page.addInitScript(() => {
|
||||
window.APP_CONFIG = {
|
||||
walletConnect: {
|
||||
bridge: "https://radicle.bridge.walletconnect.org",
|
||||
},
|
||||
reactions: [],
|
||||
seeds: {
|
||||
pinned: [{ host: "0.0.0.0", emoji: "🚀" }],
|
||||
},
|
||||
projects: {
|
||||
pinned: [
|
||||
{
|
||||
name: "source-browsing",
|
||||
urn: "rad:git:hnrkgd7sjt79k4j59ddh11ooxg18rk7soej8o",
|
||||
seed: "0.0.0.0",
|
||||
},
|
||||
],
|
||||
},
|
||||
};
|
||||
});
|
||||
await page.addInitScript(appConfigWithFixture);
|
||||
|
||||
await page.goto("/#/");
|
||||
await expect(page).toHaveURL("/#/");
|
||||
|
||||
@@ -1,30 +1,11 @@
|
||||
import { test, expect } from "@tests/support/fixtures.js";
|
||||
import { test, expect, appConfigWithFixture } from "@tests/support/fixtures.js";
|
||||
import {
|
||||
expectBackAndForwardNavigationWorks,
|
||||
expectUrlPersistsReload,
|
||||
} from "@tests/support/router.js";
|
||||
|
||||
test("navigate between landing and project page", async ({ page }) => {
|
||||
await page.addInitScript(() => {
|
||||
window.APP_CONFIG = {
|
||||
walletConnect: {
|
||||
bridge: "https://radicle.bridge.walletconnect.org",
|
||||
},
|
||||
reactions: [],
|
||||
seeds: {
|
||||
pinned: [{ host: "0.0.0.0", emoji: "🚀" }],
|
||||
},
|
||||
projects: {
|
||||
pinned: [
|
||||
{
|
||||
name: "source-browsing",
|
||||
urn: "rad:git:hnrkgd7sjt79k4j59ddh11ooxg18rk7soej8o",
|
||||
seed: "0.0.0.0",
|
||||
},
|
||||
],
|
||||
},
|
||||
};
|
||||
});
|
||||
await page.addInitScript(appConfigWithFixture);
|
||||
|
||||
await page.goto("/");
|
||||
await expect(page).toHaveURL("/");
|
||||
|
||||
@@ -1,30 +1,11 @@
|
||||
import { test, expect } from "@tests/support/fixtures.js";
|
||||
import { test, expect, appConfigWithFixture } from "@tests/support/fixtures.js";
|
||||
|
||||
test.use({
|
||||
customAppConfig: true,
|
||||
});
|
||||
|
||||
test("show pinned projects", async ({ page }) => {
|
||||
await page.addInitScript(() => {
|
||||
window.APP_CONFIG = {
|
||||
walletConnect: {
|
||||
bridge: "https://radicle.bridge.walletconnect.org",
|
||||
},
|
||||
reactions: [],
|
||||
seeds: {
|
||||
pinned: [{ host: "0.0.0.0", emoji: "🚀" }],
|
||||
},
|
||||
projects: {
|
||||
pinned: [
|
||||
{
|
||||
name: "source-browsing",
|
||||
urn: "rad:git:hnrkgd7sjt79k4j59ddh11ooxg18rk7soej8o",
|
||||
seed: "0.0.0.0",
|
||||
},
|
||||
],
|
||||
},
|
||||
};
|
||||
});
|
||||
await page.addInitScript(appConfigWithFixture);
|
||||
await page.goto("/");
|
||||
await expect(
|
||||
page.locator("text=Explore projects on the Radicle network."),
|
||||
|
||||
@@ -156,3 +156,24 @@ function log(text: string, label: string, outputLog: Stream.Writable) {
|
||||
console.log(output);
|
||||
}
|
||||
}
|
||||
|
||||
export function appConfigWithFixture() {
|
||||
window.APP_CONFIG = {
|
||||
walletConnect: {
|
||||
bridge: "https://radicle.bridge.walletconnect.org",
|
||||
},
|
||||
reactions: [],
|
||||
seeds: {
|
||||
pinned: [{ host: "0.0.0.0", emoji: "🚀" }],
|
||||
},
|
||||
projects: {
|
||||
pinned: [
|
||||
{
|
||||
name: "source-browsing",
|
||||
urn: "rad:git:hnrkgd7sjt79k4j59ddh11ooxg18rk7soej8o",
|
||||
seed: "0.0.0.0",
|
||||
},
|
||||
],
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user