From 36f90558aab79a57eaae1d0b0ab6134170a57b77 Mon Sep 17 00:00:00 2001 From: bush1D3v Date: Mon, 16 Sep 2024 14:02:11 -0300 Subject: [PATCH] bomb commit --- .dockerignore | 2 + .gitignore | 2 + .storybook/main.ts | 32 ++- .storybook/manager.ts | 2 +- .storybook/preview.ts | 16 +- Dockerfile | 6 +- README.md | 22 +- docker-compose.yml | 16 +- e2e/about-us.spec.ts | 45 ++++ e2e/home.spec.ts | 35 +++ e2e/tsconfig.json | 4 + index.html | 5 + mocks/components/HoverCard.ts | 9 + mocks/components/tags/Image.ts | 9 + mocks/components/tags/Link.ts | 7 + package.json | 37 +-- playwright.config.ts | 86 +++++++ public/sitemap.xml | 2 +- src/App.vue | 3 +- src/assets/css/main.css | 60 ++--- src/components/Accordion.vue | 54 ++++ src/components/Badges.vue | 63 +++++ src/components/Dropdown.vue | 59 +++++ src/components/Dto/AccordionDto.ts | 22 ++ src/components/Dto/BadgesDto.ts | 31 +++ src/components/HoverCard.vue | 49 ++++ src/components/Layout/Footer.vue | 7 + src/components/Layout/Footer/Footer.vue | 7 - src/components/Layout/Header.vue | 11 + src/components/Layout/Header/Header.vue | 7 - src/components/Layout/index.ts | 4 - src/components/SearchBar.vue | 168 +++++++++++++ src/components/Svg/ImageSkeletonSvg.vue | 22 ++ src/components/ui/accordion/Accordion.vue | 19 ++ .../ui/accordion/AccordionContent.vue | 24 ++ src/components/ui/accordion/AccordionItem.vue | 21 ++ .../ui/accordion/AccordionTrigger.vue | 29 +++ src/components/ui/accordion/index.ts | 4 + src/components/ui/avatar/Avatar.vue | 24 ++ src/components/ui/avatar/AvatarFallback.vue | 11 + src/components/ui/avatar/AvatarImage.vue | 9 + src/components/ui/avatar/index.ts | 24 ++ src/components/ui/button/Button.spec.ts | 24 -- src/components/ui/button/Button.stories.ts | 85 ------- src/components/ui/button/Button.vue | 13 +- src/components/ui/button/index.ts | 56 ++--- src/components/ui/command/Command.vue | 28 +++ src/components/ui/command/CommandDialog.vue | 22 ++ src/components/ui/command/CommandEmpty.vue | 20 ++ src/components/ui/command/CommandGroup.vue | 27 ++ src/components/ui/command/CommandInput.vue | 30 +++ src/components/ui/command/CommandItem.vue | 26 ++ src/components/ui/command/CommandList.vue | 27 ++ .../ui/command/CommandSeparator.vue | 23 ++ src/components/ui/command/CommandShortcut.vue | 14 ++ src/components/ui/command/index.ts | 9 + src/components/ui/dialog/Dialog.vue | 14 ++ src/components/ui/dialog/DialogClose.vue | 11 + src/components/ui/dialog/DialogContent.vue | 44 ++++ .../ui/dialog/DialogDescription.vue | 24 ++ src/components/ui/dialog/DialogFooter.vue | 19 ++ src/components/ui/dialog/DialogHeader.vue | 16 ++ .../ui/dialog/DialogScrollContent.vue | 51 ++++ src/components/ui/dialog/DialogTitle.vue | 29 +++ src/components/ui/dialog/DialogTrigger.vue | 11 + src/components/ui/dialog/index.ts | 9 + .../ui/dropdown-menu/DropdownMenu.vue | 14 ++ .../DropdownMenuCheckboxItem.vue | 37 +++ .../ui/dropdown-menu/DropdownMenuContent.vue | 36 +++ .../ui/dropdown-menu/DropdownMenuGroup.vue | 11 + .../ui/dropdown-menu/DropdownMenuItem.vue | 25 ++ .../ui/dropdown-menu/DropdownMenuLabel.vue | 24 ++ .../dropdown-menu/DropdownMenuRadioGroup.vue | 19 ++ .../dropdown-menu/DropdownMenuRadioItem.vue | 38 +++ .../dropdown-menu/DropdownMenuSeparator.vue | 22 ++ .../ui/dropdown-menu/DropdownMenuShortcut.vue | 14 ++ .../ui/dropdown-menu/DropdownMenuSub.vue | 19 ++ .../dropdown-menu/DropdownMenuSubContent.vue | 28 +++ .../dropdown-menu/DropdownMenuSubTrigger.vue | 33 +++ .../ui/dropdown-menu/DropdownMenuTrigger.vue | 13 + src/components/ui/dropdown-menu/index.ts | 16 ++ src/components/ui/hover-card/HoverCard.vue | 19 ++ .../ui/hover-card/HoverCardContent.vue | 37 +++ .../ui/hover-card/HoverCardTrigger.vue | 11 + src/components/ui/hover-card/index.ts | 3 + src/components/ui/skeleton/Skeleton.vue | 16 ++ src/components/ui/skeleton/index.ts | 1 + src/enum/RoutesEnum.ts | 113 +++++++++ src/router/index.ts | 64 ++++- src/tags/Image.vue | 19 ++ src/tags/Link.vue | 18 ++ src/views/About.vue | 14 -- src/views/AboutUs.vue | 21 ++ src/views/Home.vue | 9 +- stories/components/Accordion.stories.ts | 46 ++++ stories/components/Badges.stories.ts | 46 ++++ stories/components/HoverCard.stories.ts | 66 +++++ stories/components/Layout/Footer.stories.ts | 35 +++ stories/components/Layout/Header.stories.ts | 35 +++ stories/tags/Image.stories.ts | 80 ++++++ stories/tags/Link.stories.ts | 70 ++++++ tailwind.config.js | 230 +++++++++--------- tests/components/Accordion.spec.ts | 35 +++ tests/components/Badges.spec.ts | 34 +++ tests/components/HoverCard.spec.ts | 28 +++ tests/components/Layout/Footer.spec.ts | 30 +++ tests/components/Layout/Header.spec.ts | 30 +++ .../Layout/__snapshots__/Footer.spec.ts.snap | 3 + .../Layout/__snapshots__/Header.spec.ts.snap | 3 + .../__snapshots__/Accordion.spec.ts.snap | 30 +++ .../__snapshots__/Badges.spec.ts.snap | 54 ++++ .../__snapshots__/HoverCard.spec.ts.snap | 7 + tests/tags/Image.spec.ts | 25 ++ tests/tags/Link.spec.ts | 39 +++ tests/tags/__snapshots__/Image.spec.ts.snap | 3 + tests/tags/__snapshots__/Link.spec.ts.snap | 3 + tsconfig.app.json | 2 +- vite.config.ts | 66 ++--- 118 files changed, 2963 insertions(+), 432 deletions(-) create mode 100644 e2e/about-us.spec.ts create mode 100644 e2e/home.spec.ts create mode 100644 e2e/tsconfig.json create mode 100644 mocks/components/HoverCard.ts create mode 100644 mocks/components/tags/Image.ts create mode 100644 mocks/components/tags/Link.ts create mode 100644 playwright.config.ts create mode 100644 src/components/Accordion.vue create mode 100644 src/components/Badges.vue create mode 100644 src/components/Dropdown.vue create mode 100644 src/components/Dto/AccordionDto.ts create mode 100644 src/components/Dto/BadgesDto.ts create mode 100644 src/components/HoverCard.vue create mode 100644 src/components/Layout/Footer.vue delete mode 100644 src/components/Layout/Footer/Footer.vue create mode 100644 src/components/Layout/Header.vue delete mode 100644 src/components/Layout/Header/Header.vue delete mode 100644 src/components/Layout/index.ts create mode 100644 src/components/SearchBar.vue create mode 100644 src/components/Svg/ImageSkeletonSvg.vue create mode 100644 src/components/ui/accordion/Accordion.vue create mode 100644 src/components/ui/accordion/AccordionContent.vue create mode 100644 src/components/ui/accordion/AccordionItem.vue create mode 100644 src/components/ui/accordion/AccordionTrigger.vue create mode 100644 src/components/ui/accordion/index.ts create mode 100644 src/components/ui/avatar/Avatar.vue create mode 100644 src/components/ui/avatar/AvatarFallback.vue create mode 100644 src/components/ui/avatar/AvatarImage.vue create mode 100644 src/components/ui/avatar/index.ts delete mode 100644 src/components/ui/button/Button.spec.ts delete mode 100644 src/components/ui/button/Button.stories.ts create mode 100644 src/components/ui/command/Command.vue create mode 100644 src/components/ui/command/CommandDialog.vue create mode 100644 src/components/ui/command/CommandEmpty.vue create mode 100644 src/components/ui/command/CommandGroup.vue create mode 100644 src/components/ui/command/CommandInput.vue create mode 100644 src/components/ui/command/CommandItem.vue create mode 100644 src/components/ui/command/CommandList.vue create mode 100644 src/components/ui/command/CommandSeparator.vue create mode 100644 src/components/ui/command/CommandShortcut.vue create mode 100644 src/components/ui/command/index.ts create mode 100644 src/components/ui/dialog/Dialog.vue create mode 100644 src/components/ui/dialog/DialogClose.vue create mode 100644 src/components/ui/dialog/DialogContent.vue create mode 100644 src/components/ui/dialog/DialogDescription.vue create mode 100644 src/components/ui/dialog/DialogFooter.vue create mode 100644 src/components/ui/dialog/DialogHeader.vue create mode 100644 src/components/ui/dialog/DialogScrollContent.vue create mode 100644 src/components/ui/dialog/DialogTitle.vue create mode 100644 src/components/ui/dialog/DialogTrigger.vue create mode 100644 src/components/ui/dialog/index.ts create mode 100644 src/components/ui/dropdown-menu/DropdownMenu.vue create mode 100644 src/components/ui/dropdown-menu/DropdownMenuCheckboxItem.vue create mode 100644 src/components/ui/dropdown-menu/DropdownMenuContent.vue create mode 100644 src/components/ui/dropdown-menu/DropdownMenuGroup.vue create mode 100644 src/components/ui/dropdown-menu/DropdownMenuItem.vue create mode 100644 src/components/ui/dropdown-menu/DropdownMenuLabel.vue create mode 100644 src/components/ui/dropdown-menu/DropdownMenuRadioGroup.vue create mode 100644 src/components/ui/dropdown-menu/DropdownMenuRadioItem.vue create mode 100644 src/components/ui/dropdown-menu/DropdownMenuSeparator.vue create mode 100644 src/components/ui/dropdown-menu/DropdownMenuShortcut.vue create mode 100644 src/components/ui/dropdown-menu/DropdownMenuSub.vue create mode 100644 src/components/ui/dropdown-menu/DropdownMenuSubContent.vue create mode 100644 src/components/ui/dropdown-menu/DropdownMenuSubTrigger.vue create mode 100644 src/components/ui/dropdown-menu/DropdownMenuTrigger.vue create mode 100644 src/components/ui/dropdown-menu/index.ts create mode 100644 src/components/ui/hover-card/HoverCard.vue create mode 100644 src/components/ui/hover-card/HoverCardContent.vue create mode 100644 src/components/ui/hover-card/HoverCardTrigger.vue create mode 100644 src/components/ui/hover-card/index.ts create mode 100644 src/components/ui/skeleton/Skeleton.vue create mode 100644 src/components/ui/skeleton/index.ts create mode 100644 src/enum/RoutesEnum.ts create mode 100644 src/tags/Image.vue create mode 100644 src/tags/Link.vue delete mode 100644 src/views/About.vue create mode 100644 src/views/AboutUs.vue create mode 100644 stories/components/Accordion.stories.ts create mode 100644 stories/components/Badges.stories.ts create mode 100644 stories/components/HoverCard.stories.ts create mode 100644 stories/components/Layout/Footer.stories.ts create mode 100644 stories/components/Layout/Header.stories.ts create mode 100644 stories/tags/Image.stories.ts create mode 100644 stories/tags/Link.stories.ts create mode 100644 tests/components/Accordion.spec.ts create mode 100644 tests/components/Badges.spec.ts create mode 100644 tests/components/HoverCard.spec.ts create mode 100644 tests/components/Layout/Footer.spec.ts create mode 100644 tests/components/Layout/Header.spec.ts create mode 100644 tests/components/Layout/__snapshots__/Footer.spec.ts.snap create mode 100644 tests/components/Layout/__snapshots__/Header.spec.ts.snap create mode 100644 tests/components/__snapshots__/Accordion.spec.ts.snap create mode 100644 tests/components/__snapshots__/Badges.spec.ts.snap create mode 100644 tests/components/__snapshots__/HoverCard.spec.ts.snap create mode 100644 tests/tags/Image.spec.ts create mode 100644 tests/tags/Link.spec.ts create mode 100644 tests/tags/__snapshots__/Image.spec.ts.snap create mode 100644 tests/tags/__snapshots__/Link.spec.ts.snap diff --git a/.dockerignore b/.dockerignore index c2923d8..ebe0776 100644 --- a/.dockerignore +++ b/.dockerignore @@ -8,3 +8,5 @@ CONTRIBUTING.md LICENSE README.md SECURITY.md +test-results +playwright-report diff --git a/.gitignore b/.gitignore index ecfdb4f..d504dd4 100644 --- a/.gitignore +++ b/.gitignore @@ -35,3 +35,5 @@ yarn.lock pnpm-lock.yaml *storybook.log +test-results +playwright-report diff --git a/.storybook/main.ts b/.storybook/main.ts index 5d43640..ab1922e 100644 --- a/.storybook/main.ts +++ b/.storybook/main.ts @@ -1,21 +1,19 @@ -import type {StorybookConfig} from "@storybook/vue3-vite"; +import type { StorybookConfig } from "@storybook/vue3-vite"; const config: StorybookConfig = { - stories: ["../src/**/*.mdx", "../src/**/*.stories.@(js|jsx|mjs|ts|tsx)"], - addons: [ - "@storybook/addon-onboarding", - "@storybook/addon-links", - "@storybook/addon-essentials", - "@chromatic-com/storybook", - "@storybook/addon-interactions", - ], - framework: { - name: "@storybook/vue3-vite", - options: {}, - }, - docs: { - autodocs: "tag", - }, - staticDirs: ["../public"], + stories: [ "../stories/**/*.stories.ts" ], + addons: [ + "@storybook/addon-onboarding", + "@storybook/addon-links", + "@storybook/addon-essentials", + "@chromatic-com/storybook", + "@storybook/addon-interactions", + ], + framework: { + name: "@storybook/vue3-vite", + options: {}, + }, + docs: {}, + staticDirs: [ "../public" ], }; export default config; diff --git a/.storybook/manager.ts b/.storybook/manager.ts index b51ccfb..3d99cf9 100644 --- a/.storybook/manager.ts +++ b/.storybook/manager.ts @@ -5,7 +5,7 @@ addons.setConfig({ theme: create({ base: "dark", textColor: "white", - appPreviewBg: "#333333", + appPreviewBg: "#0f101d", brandTitle: "NEI Market Analytics", brandUrl: "https://bush1d3v-portfolio.vercel.app/", brandImage: "logo.svg", diff --git a/.storybook/preview.ts b/.storybook/preview.ts index 208f92f..61b3760 100644 --- a/.storybook/preview.ts +++ b/.storybook/preview.ts @@ -20,7 +20,7 @@ const preview: Preview = { values: [ { name: "dark", - value: "#333333", + value: "#0f101d", }, { name: "light", @@ -29,8 +29,18 @@ const preview: Preview = { ], }, }, - tags: ["autodocs"], - decorators: [withActions], + tags: ["autodocs", "autodocs"], + decorators: [ + withActions, + (story) => ({ + components: {story}, + template: ` +
+ +
+ `, + }), + ], }; export default preview; diff --git a/Dockerfile b/Dockerfile index edd7213..025ebe7 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,7 +2,9 @@ FROM node:20 RUN apt-get update && apt-get install -y \ xdg-utils \ - git-all + git-all \ + libevent-2.1-7 \ + libgstreamer-plugins-bad1.0-0 WORKDIR /app @@ -14,4 +16,6 @@ EXPOSE 5173 EXPOSE 6006 +EXPOSE 9323 + CMD ["npm", "run", "dev"] diff --git a/README.md b/README.md index acb2a1d..1325fdc 100644 --- a/README.md +++ b/README.md @@ -27,7 +27,8 @@ O **NEI Market Analytics** é um projeto de código aberto projetado para fornec docker   vitest    storybook-js     - vueuse   + vueuse    + playwright   biomejs   chromatic   @@ -73,7 +74,13 @@ bun build ### Executar testes de unidade com [Vitest](https://vitest.dev/) ```sh -bun tests +bun test:unit +``` + +### Executar testes de ponta a ponta com [Playwright](https://playwright.dev/) + +```sh +bun test:e2e ``` Isso executa os testes de ponta a ponta no servidor de desenvolvimento Vite. @@ -109,7 +116,8 @@ The **NEI Market Analytics** is an open-source project designed to provide compr docker   vitest    storybook-js     - vueuse   + vueuse    + playwright   biomejs   chromatic   @@ -155,5 +163,11 @@ bun build ### Run Unit Tests with [Vitest](https://vitest.dev/) ```sh -bun tests +bun test:unit +``` + +### Run E2E Tests with [Playwright](https://playwright.dev/) + +```sh +bun test:e2e ``` diff --git a/docker-compose.yml b/docker-compose.yml index b9fa9b6..556dd41 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -6,10 +6,7 @@ services: volumes: - .:/app working_dir: /app - environment: - - GIT_USER_EMAIL=${GIT_USER_EMAIL} - - GIT_USER_NAME=${GIT_USER_NAME} - command: sh -c "git config --global user.email \"$GIT_USER_EMAIL\" && git config --global user.name \"$GIT_USER_NAME\" && git config --global --add safe.directory /app && npm run dev" + command: npm run dev ports: - "5173:5173" @@ -26,3 +23,14 @@ services: - "6006:6006" depends_on: - vue + + playwright: + image: node:20 + volumes: + - .:/app + working_dir: /app + command: sh -c "npx playwright install-deps && npx playwright install chromium && npx playwright install firefox && apt-get install -y xvfb xauth && xvfb-run -- npx playwright test --ui" + ports: + - "9323:9323" + depends_on: + - vue diff --git a/e2e/about-us.spec.ts b/e2e/about-us.spec.ts new file mode 100644 index 0000000..86d06d5 --- /dev/null +++ b/e2e/about-us.spec.ts @@ -0,0 +1,45 @@ +import { test, expect } from "@playwright/test"; + +test.describe("About Us Page Tests", () => { + test("Visits the about-us page and checks content", async ({ page }) => { + await page.goto("/about-us"); + + const mainContent = page.locator("main.container"); + await expect(mainContent).toBeVisible(); + + const h1 = mainContent.locator("h1"); + await expect(h1).toHaveText("Impulsionando o Futuro Juntos"); + + const h2 = mainContent.locator("h2"); + await expect(h2).toHaveText("Colaborando para um amanhã mais tecnológico."); + + const p = mainContent.locator("p"); + await expect(p).toHaveText("Por Trás dos Códigos"); + + const header = page.locator("header"); + await expect(header).toBeVisible(); + + const footer = page.locator("footer"); + await expect(footer).toBeVisible(); + }); + + test("Checks visibility of Accordion and Badges components", async ({ page }) => { + await page.goto("/about-us"); + + const accordion = page.locator("[data-testid='Accordion']"); + await expect(accordion).toBeVisible(); + + const badges = page.locator("[data-testid='Badges']"); + await expect(badges).toBeVisible(); + }); + + // test("Checks navigation back to home", async ({ page }) => { + // await page.goto("/about-us"); + + // const homeLink = page.locator("a[href='/']"); + // await expect(homeLink).toBeVisible(); + // await homeLink.click(); + + // await expect(page).toHaveURL("/"); + // }); +}); diff --git a/e2e/home.spec.ts b/e2e/home.spec.ts new file mode 100644 index 0000000..b98ad8c --- /dev/null +++ b/e2e/home.spec.ts @@ -0,0 +1,35 @@ +import { test, expect } from "@playwright/test"; + +test.describe("Home Page Tests", () => { + test("Visits the app root url and checks main content", async ({ page }) => { + await page.goto("/"); + + const mainContainer = page.locator("main.container"); + await expect(mainContainer).toBeVisible(); + await expect(mainContainer).toHaveText("NEI Market Analytics"); + }); + + test("Checks visibility of header", async ({ page }) => { + await page.goto("/"); + + const header = page.locator("header"); + await expect(header).toBeVisible(); + }); + + test("Checks visibility of footer", async ({ page }) => { + await page.goto("/"); + + const footer = page.locator("footer"); + await expect(footer).toBeVisible(); + }); + + test("Checks clickable text and navigation to about-us", async ({ page }) => { + await page.goto("/"); + + const clickableText = page.locator("main.container >> text=NEI Market Analytics"); + await expect(clickableText).toBeVisible(); + await clickableText.click(); + + await expect(page).toHaveURL("/about-us"); + }); +}); diff --git a/e2e/tsconfig.json b/e2e/tsconfig.json new file mode 100644 index 0000000..dfdb9af --- /dev/null +++ b/e2e/tsconfig.json @@ -0,0 +1,4 @@ +{ + "extends": "@tsconfig/node20/tsconfig.json", + "include": ["./**/*"] +} diff --git a/index.html b/index.html index 85a6462..0a0c6c4 100644 --- a/index.html +++ b/index.html @@ -19,6 +19,11 @@ + + + NEI Market Analytics diff --git a/mocks/components/HoverCard.ts b/mocks/components/HoverCard.ts new file mode 100644 index 0000000..d0adca1 --- /dev/null +++ b/mocks/components/HoverCard.ts @@ -0,0 +1,9 @@ +import type {HoverCardProps} from "@/components/HoverCard.vue"; + +export const HoverCardMock: HoverCardProps = { + title: "John Doe", + description: "Creator of Radix UI and Figma's design system", + startDate: "February 2022", + avatarSrc: "https://avatars.githubusercontent.com/u/11473738?v=4", + avatarFallback: "JD", +}; diff --git a/mocks/components/tags/Image.ts b/mocks/components/tags/Image.ts new file mode 100644 index 0000000..5399308 --- /dev/null +++ b/mocks/components/tags/Image.ts @@ -0,0 +1,9 @@ +import type {ImageProps} from "@/tags/Image.vue"; + +export const ImageMock: ImageProps = { + alt: "image", + height: "80", + width: "80", + src: "https://via.placeholder.com/80", + class: "w-20 h-20 rounded-full", +}; diff --git a/mocks/components/tags/Link.ts b/mocks/components/tags/Link.ts new file mode 100644 index 0000000..82619f2 --- /dev/null +++ b/mocks/components/tags/Link.ts @@ -0,0 +1,7 @@ +import type {LinkProps} from "@/tags/Link.vue"; + +export const LinkMock: LinkProps = { + href: "https://www.google.com", + target: "_blank", + class: "font-bold underline", +}; diff --git a/package.json b/package.json index 6b69c37..70e823b 100644 --- a/package.json +++ b/package.json @@ -6,18 +6,21 @@ "license": "MIT", "scripts": { "dev": "vite", - "build": "run-p type-check \"build-only {@}\" --", + "builds": "run-p type-check \"build-only {@}\" --", "preview": "vite preview", - "tests": "vitest", + "test:unit": "vitest", + "test:e2e": "playwright test", + "test:report": "bunx playwright show-report", + "test:e2e-ui": "bunx playwright test --ui", "storybook": "storybook dev -p 6006", "lint": "npx @biomejs/biome format --write ./", "build-only": "vite build", "type-check": "vue-tsc --build --force", + "build-storybook": "storybook build", "docker-build": "docker-compose build", "docker-run": "docker build -t nei_market_analytics .", "docker-up": "docker-compose up", - "docker-clean": "docker-compose down", - "build-storybook": "storybook build" + "docker-clean": "docker-compose down" }, "dependencies": { "@radix-icons/vue": "^1.0.0", @@ -33,18 +36,19 @@ "vue-router": "^4.3.3" }, "devDependencies": { + "@playwright/test": "^1.44.1", "@biomejs/biome": "^1.8.3", - "@chromatic-com/storybook": "^1.9.0", - "@storybook/addon-essentials": "^8.2.9", - "@storybook/addon-interactions": "^8.2.9", - "@storybook/addon-links": "^8.2.9", - "@storybook/addon-onboarding": "^8.2.9", - "@storybook/blocks": "^8.2.9", - "@storybook/manager-api": "^8.2.9", - "@storybook/test": "^8.2.9", - "@storybook/theming": "^8.2.9", - "@storybook/vue3": "^8.2.9", - "@storybook/vue3-vite": "^8.2.9", + "@chromatic-com/storybook": "^2.0.2", + "@storybook/addon-essentials": "^8.3.0", + "@storybook/addon-interactions": "^8.3.0", + "@storybook/addon-links": "^8.3.0", + "@storybook/addon-onboarding": "^8.3.0", + "@storybook/blocks": "^8.3.0", + "@storybook/manager-api": "^8.3.0", + "@storybook/test": "^8.3.0", + "@storybook/theming": "^8.3.0", + "@storybook/vue3": "^8.3.0", + "@storybook/vue3-vite": "^8.3.0", "@testing-library/vue": "^8.1.0", "@tsconfig/node20": "^20.1.4", "@types/jsdom": "^21.1.7", @@ -56,9 +60,8 @@ "autoprefixer": "^10.4.20", "jsdom": "^25.0.0", "npm-run-all2": "^6.2.0", - "shadcn-nuxt": "^0.10.4", "start-server-and-test": "^2.0.4", - "storybook": "^8.2.9", + "storybook": "^8.3.0", "typescript": "~5.5.4", "vite": "^5.3.1", "vite-plugin-vue-devtools": "^7.3.1", diff --git a/playwright.config.ts b/playwright.config.ts new file mode 100644 index 0000000..29d34c6 --- /dev/null +++ b/playwright.config.ts @@ -0,0 +1,86 @@ +import process from "node:process"; +import { defineConfig, devices } from "@playwright/test"; + +/** + * Read environment variables from file. + * https://github.com/motdotla/dotenv + */ +// require('dotenv').config(); + +/** + * See https://playwright.dev/docs/test-configuration. + */ +export default defineConfig({ + testDir: "./e2e", + /* Maximum time one test can run for. */ + timeout: 30 * 1000, + expect: { + /** + * Maximum time expect() should wait for the condition to be met. + * For example in `await expect(locator).toHaveText();` + */ + timeout: 5000, + }, + /* Fail the build on CI if you accidentally left test.only in the source code. */ + forbidOnly: !!process.env.CI, + /* Retry on CI only */ + retries: process.env.CI ? 2 : 0, + /* Opt out of parallel tests on CI. */ + workers: process.env.CI ? 1 : undefined, + /* Reporter to use. See https://playwright.dev/docs/test-reporters */ + reporter: [ [ 'html', { outputFolder: 'playwright-report' } ] ], + /* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */ + use: { + /* Maximum time each action such as `click()` can take. Defaults to 0 (no limit). */ + actionTimeout: 0, + /* Base URL to use in actions like `await page.goto('/')`. */ + baseURL: "http://localhost:5173", + + /* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */ + trace: "on-first-retry", + + /* Only on CI systems run the tests headless */ + headless: !!process.env.CI, + + /* Take a screenshot on failure */ + screenshot: 'only-on-failure', + video: 'retain-on-failure', + }, + + /* Configure projects for major browsers */ + projects: [ + { + name: "chromium", + use: { + ...devices[ "Desktop Chrome" ], + }, + }, + { + name: "firefox", + use: { + ...devices[ "Desktop Firefox" ], + }, + }, + { + name: "Mobile Chrome", + use: { + ...devices[ "Pixel 5" ], + }, + }, + ], + + /* Folder for test artifacts such as screenshots, videos, traces, etc. */ + // outputDir: 'test-results/', + + /* Run your local dev server before starting the tests */ + webServer: { + /** + * Use the dev server by default for faster feedback loop. + * Use the preview server on CI for more realistic testing. + * Playwright will re-use the local server if there is already a dev-server running. + */ + command: process.env.CI ? "vite preview --port 5173" : "vite dev", + port: 5173, + reuseExistingServer: !process.env.CI, + }, +}); diff --git a/public/sitemap.xml b/public/sitemap.xml index 2595c3e..6e70dba 100644 --- a/public/sitemap.xml +++ b/public/sitemap.xml @@ -7,7 +7,7 @@ 1.0 - http://localhost:5173/about + http://localhost:5173/about-us 2023-10-01 monthly 0.8 diff --git a/src/App.vue b/src/App.vue index 6d7b1b5..936445c 100644 --- a/src/App.vue +++ b/src/App.vue @@ -1,6 +1,7 @@