Improve testing suite

Signed-off-by: Sebastian Martinez <sebastinez@me.com>
This commit is contained in:
Sebastian Martinez
2022-03-24 15:05:15 +01:00
parent 6f2f8c454f
commit 286cb1cd21
44 changed files with 2550 additions and 482 deletions
+25 -6
View File
@@ -1,18 +1,37 @@
import SeedAddress from "./SeedAddress.svelte";
import { mount } from "radicle-svelte-unit-test";
import { styles } from "@test/support/index";
import { render } from "@testing-library/svelte";
import "@public/index.css";
describe('SeedAddress', function () {
it("Renders correctly", () => {
mount(SeedAddress, {
it("shows the seed emoji and seed host", () => {
render(SeedAddress, {
props: {
seed: {
id: "hydkkkf5ksbe5fuszdhpqhytu3q36gwagj874wxwpo5a8ti8coygh1",
emoji: "🐱",
host: "seed.cloudhead.io",
},
port: 8776
}
}, styles);
cy.findByText("seed.cloudhead.io").should("exist").should("have.attr", "href", "/seeds/seed.cloudhead.io");
});
cy.get("span.seed-icon").should("have.text", "🐱");
cy.findByText("seed.cloudhead.io").should("have.attr", "href", "/seeds/seed.cloudhead.io").should("be.visible");
});
it("shows the full seed id", () => {
render(SeedAddress, {
props: {
seed: {
id: "hydkkkf5ksbe5fuszdhpqhytu3q36gwagj874wxwpo5a8ti8coygh1",
emoji: "🐱",
host: "seed.cloudhead.io",
},
port: 8776,
full: true
}
});
cy.get("span.seed-icon").should("have.text", "🐱");
cy.findByText("hydkkk…coygh1@seed.cloudhead.io").should("be.visible");
cy.findByText(":8776").should("be.visible");
});
});