-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Rūdolfs Ošiņš <[email protected]>
- Loading branch information
Showing
1 changed file
with
38 additions
and
24 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,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…[email protected]") | ||
.should("be.visible"); | ||
cy.get("body").contains(":8776").should("be.visible"); | ||
}); | ||
cy.get("span.seed-icon").should("have.text", "🐱"); | ||
cy.get("body") | ||
.contains("hydkkk…[email protected]") | ||
.should("be.visible"); | ||
cy.get("body").contains(":8776").should("be.visible"); | ||
}); | ||
}); |