Skip to content

Commit

Permalink
feat: export headless testing utils (#167)
Browse files Browse the repository at this point in the history
Set up playwright exports and export reusable combobox testing util.

## Checklist

- [x] The added / edited code has been documented with
[JSDoc](https://jsdoc.app/about-getting-started)
- [x] All changes are documented in the documentation app (folder
`apps/docs`)
- [x] If a new component is added, at least one [Playwright screenshot
test](https://github.com/SchwarzIT/onyx/actions/workflows/playwright-screenshots.yml)
is added
- [x] A changeset is added with `npx changeset add` if your changes
should be released as npm package (because they affect the library
usage)
  • Loading branch information
JoCa96 authored Jan 23, 2024
1 parent 647cefb commit f427105
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/thirty-timers-allow.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@sit-onyx/headless": minor
---

Enable export of headless testing util
5 changes: 4 additions & 1 deletion packages/headless/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,13 @@
"exports": {
".": {
"default": "./src/index.ts"
},
"./playwright": {
"default": "./src/playwright.ts"
}
},
"scripts": {
"build": "tsc --noEmit",
"build": "vue-tsc --build --force",
"test:components": "playwright install && playwright test"
},
"peerDependencies": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ test("combobox", async ({ mount, page }) => {
/**
* Test an implementation of the combobox based on https://w3c.github.io/aria/#combobox
*/
const comboboxTesting = async (
export const comboboxTesting = async (
page: Page,
listbox: Locator,
combobox: Locator,
Expand Down
1 change: 1 addition & 0 deletions packages/headless/src/playwright.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { comboboxTesting } from "./composables/comboBox/TestDropdown.ct";
1 change: 1 addition & 0 deletions packages/headless/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,6 @@
"compilerOptions": {
"rootDir": "./src",
"baseUrl": ".",
"noEmit": true,
},
}
1 change: 1 addition & 0 deletions packages/sit-onyx/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
"@axe-core/playwright": "^4.8.3",
"@fontsource-variable/source-code-pro": "^5.0.17",
"@fontsource-variable/source-sans-3": "^5.0.19",
"@sit-onyx/headless": "workspace:^",
"@sit-onyx/storybook-utils": "workspace:^",
"@storybook/addon-essentials": "^7.6.10",
"@storybook/blocks": "^7.6.10",
Expand Down
3 changes: 3 additions & 0 deletions pnpm-lock.yaml

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

0 comments on commit f427105

Please sign in to comment.