Skip to content

Commit

Permalink
fixup! Update component specs
Browse files Browse the repository at this point in the history
Signed-off-by: Rūdolfs Ošiņš <[email protected]>
  • Loading branch information
rudolfs committed Sep 26, 2022
1 parent 7762864 commit 0bbdccd
Showing 1 changed file with 38 additions and 24 deletions.
62 changes: 38 additions & 24 deletions src/SeedAddress.spec.ts
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");
});
});

0 comments on commit 0bbdccd

Please sign in to comment.