diff --git a/src/SeedAddress.spec.ts b/src/SeedAddress.spec.ts index 4e4b4edaa2..5e8b046051 100644 --- a/src/SeedAddress.spec.ts +++ b/src/SeedAddress.spec.ts @@ -1,39 +1,53 @@ +import { Seed } from "@app/base/seeds/Seed"; +import { getConfig } from "@app/config"; + import SeedAddress from "./SeedAddress.svelte"; describe("SeedAddress", () => { it("shows the seed emoji and seed host", () => { - cy.mount(SeedAddress, { - props: { - seed: { - id: "hydkkkf5ksbe5fuszdhpqhytu3q36gwagj874wxwpo5a8ti8coygh1", - emoji: "🐱", + getConfig().then(cfg => { + const seed = new Seed( + { host: "seed.cloudhead.io", + id: "hydkkkf5ksbe5fuszdhpqhytu3q36gwagj874wxwpo5a8ti8coygh1", + }, + cfg, + ); + + cy.mount(SeedAddress, { + props: { + seed, + port: 8776, }, - port: 8776, - }, + }); + cy.get("span.seed-icon").should("have.text", "🐱"); + cy.contains("seed.cloudhead.io") + .should("have.attr", "href", "/seeds/seed.cloudhead.io") + .should("be.visible"); }); - cy.get("span.seed-icon").should("have.text", "🐱"); - cy.contains("seed.cloudhead.io") - .should("have.attr", "href", "/seeds/seed.cloudhead.io") - .should("be.visible"); }); it("shows the full seed id", () => { - cy.mount(SeedAddress, { - props: { - seed: { - id: "hydkkkf5ksbe5fuszdhpqhytu3q36gwagj874wxwpo5a8ti8coygh1", - emoji: "🐱", + getConfig().then(cfg => { + const seed = new Seed( + { host: "seed.cloudhead.io", + id: "hydkkkf5ksbe5fuszdhpqhytu3q36gwagj874wxwpo5a8ti8coygh1", + }, + cfg, + ); + cy.mount(SeedAddress, { + props: { + seed, + port: 8776, + full: true, }, - port: 8776, - full: true, - }, + }); + cy.get("span.seed-icon").should("have.text", "🐱"); + cy.get("body") + .contains("hydkkk…coygh1@seed.cloudhead.io") + .should("be.visible"); + cy.get("body").contains(":8776").should("be.visible"); }); - cy.get("span.seed-icon").should("have.text", "🐱"); - cy.get("body") - .contains("hydkkk…coygh1@seed.cloudhead.io") - .should("be.visible"); - cy.get("body").contains(":8776").should("be.visible"); }); });