-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: setup unit and component testing for tailwind-components module (
#4725) chore: setup unit and component testing for tailwind-components module - setup tools - add unit example - add component example - add task to call via gradle
- Loading branch information
1 parent
8701d15
commit b3b9c18
Showing
15 changed files
with
323 additions
and
130 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
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
2 changes: 1 addition & 1 deletion
2
...onents/tests/components/buttonBar.spec.ts → ...nd-components/tests/e2e/buttonBar.spec.ts
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
2 changes: 1 addition & 1 deletion
2
.../tests/components/form/inputEmail.spec.ts → ...ts/e2e/components/form/inputEmail.spec.ts
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
2 changes: 1 addition & 1 deletion
2
...ts/components/form/inputHyperlink.spec.ts → ...2e/components/form/inputHyperlink.spec.ts
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
2 changes: 1 addition & 1 deletion
2
.../tests/components/form/renderForm.spec.ts → ...ts/e2e/components/form/renderForm.spec.ts
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
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
...ts/tests/components/input/listbox.spec.ts → ...ests/e2e/components/input/listbox.spec.ts
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
File renamed without changes.
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
2 changes: 1 addition & 1 deletion
2
...nents/tests/components/input/tree.spec.ts → ...s/tests/e2e/components/input/tree.spec.ts
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
16 changes: 16 additions & 0 deletions
16
apps/tailwind-components/tests/vitest/components/Button.spec.ts
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 |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import { mount } from "@vue/test-utils"; | ||
import { expect, it } from "vitest"; | ||
import Button from "~/components/Button.vue"; | ||
import FloatingVue from "floating-vue"; | ||
import "floating-vue/dist/style.css"; // Ensure styles are loaded | ||
|
||
const wrapper = mount(Button, { | ||
global: { | ||
plugins: [FloatingVue], // Register the plugin | ||
}, | ||
}); | ||
|
||
it("should use the primary text class by default", async () => { | ||
expect(wrapper.html()).toContain("text-button-primary"); | ||
expect(wrapper.html()).toContain("bg-button-primary"); | ||
}); |
6 changes: 6 additions & 0 deletions
6
apps/tailwind-components/tests/vitest/utils/flattenObject.spec.ts
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 |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import { expect, test } from "vitest"; | ||
import { flattenObject } from "~/utils/flattenObject"; | ||
|
||
test("flattens the object", () => { | ||
expect(flattenObject({ a: 1, b: 2 })).toBe(" 1 2"); | ||
}); |
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
Oops, something went wrong.