Skip to content

Commit

Permalink
test: fix type check | disable old tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mlmoravek committed Feb 28, 2024
1 parent 1a33f29 commit aa93f7a
Show file tree
Hide file tree
Showing 8 changed files with 66 additions and 62 deletions.
8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import SimpleAutocomplete from "./SimpleAutocomplete.vue";
// import SimpleAutocomplete from "./SimpleAutocomplete.vue";

describe("<Autocomplete>", () => {
it("works", () => {
cy.mount(SimpleAutocomplete);
cy.get("input").click().type("j");
cy.get("input").type("{downarrow}{downarrow}{enter}");
cy.get("input").should("have.value", "Node.js");
});
});
// describe("<Autocomplete>", () => {
// it("works", () => {
// cy.mount(SimpleAutocomplete);
// cy.get("input").click().type("j");
// cy.get("input").type("{downarrow}{downarrow}{enter}");
// cy.get("input").should("have.value", "Node.js");
// });
// });
26 changes: 13 additions & 13 deletions packages/oruga/src/components/button/tests/Button.spec.cy.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import OButton from "../Button.vue";
// import OButton from "../Button.vue";

describe("<Button>", () => {
it("works", () => {
cy.mount(OButton as any, {
slots: {
default: {
render: () => "Hello Cypress!",
},
},
});
cy.get("button").contains("Hello Cypress!").click();
});
});
// describe("<Button>", () => {
// it("works", () => {
// cy.mount(OButton as any, {
// slots: {
// default: {
// render: () => "Hello Cypress!",
// },
// },
// });
// cy.get("button").contains("Hello Cypress!").click();
// });
// });
24 changes: 12 additions & 12 deletions packages/oruga/src/components/checkbox/tests/Checkbox.spec.cy.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import OCheckbox from "../Checkbox.vue";
// import OCheckbox from "../Checkbox.vue";

describe("<Checkbox>", () => {
it("works", () => {
cy.mount(OCheckbox as any);
cy.get("input[type=checkbox]").then((element) => {
const checkbox = cy.wrap(element);
checkbox.should("not.have.class", "o-chk__input--checked");
checkbox.click();
checkbox.should("have.class", "o-chk__input--checked");
});
});
});
// describe("<Checkbox>", () => {
// it("works", () => {
// cy.mount(OCheckbox as any);
// cy.get("input[type=checkbox]").then((element) => {
// const checkbox = cy.wrap(element);
// checkbox.should("not.have.class", "o-chk__input--checked");
// checkbox.click();
// checkbox.should("have.class", "o-chk__input--checked");
// });
// });
// });
44 changes: 22 additions & 22 deletions packages/oruga/src/components/collapse/tests/Collapse.spec.cy.ts
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
import SimpleCollapse from "./SimpleCollapse.vue";
// import SimpleCollapse from "./SimpleCollapse.vue";

describe("<Collapse>", () => {
it("works", () => {
cy.mount(SimpleCollapse);
cy.get(".o-clps__trigger")
.eq(0)
.next()
.find(".o-clps__content")
.should("be.visible");
cy.get(".o-clps__trigger").eq(1).click();
cy.get(".o-clps__trigger")
.eq(0)
.next()
.find(".o-clps__content")
.should("not.be.visible");
cy.get(".o-clps__trigger")
.eq(1)
.next()
.find(".o-clps__content")
.should("be.visible");
});
});
// describe("<Collapse>", () => {
// it("works", () => {
// cy.mount(SimpleCollapse);
// cy.get(".o-clps__trigger")
// .eq(0)
// .next()
// .find(".o-clps__content")
// .should("be.visible");
// cy.get(".o-clps__trigger").eq(1).click();
// cy.get(".o-clps__trigger")
// .eq(0)
// .next()
// .find(".o-clps__content")
// .should("not.be.visible");
// cy.get(".o-clps__trigger")
// .eq(1)
// .next()
// .find(".o-clps__content")
// .should("be.visible");
// });
// });
4 changes: 3 additions & 1 deletion packages/oruga/src/utils/InstanceRegistry.spec.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import InstanceRegistry from "@utils/InstanceRegistry";
import { describe, it, expect } from "vitest";

import InstanceRegistry from "./InstanceRegistry";

describe("InstanceRegistry", () => {
describe(".add", () => {
Expand Down
2 changes: 2 additions & 0 deletions packages/oruga/src/utils/config.spec.cy.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { describe, it, expect } from "vitest";

import { getOptions, setOptions } from "./config";

describe("Configuration", () => {
Expand Down
2 changes: 1 addition & 1 deletion packages/oruga/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"noImplicitAny": false,
"strictNullChecks": false,
"baseUrl": ".",
"types": ["node", "vite/client", "vitest/client"],
"types": ["node", "vite/client"],
"paths": {
"@/*": [
"src/*",
Expand Down

0 comments on commit aa93f7a

Please sign in to comment.