diff --git a/.changeset/sweet-trains-talk.md b/.changeset/sweet-trains-talk.md new file mode 100644 index 000000000..39a43ac5c --- /dev/null +++ b/.changeset/sweet-trains-talk.md @@ -0,0 +1,5 @@ +--- +"@shopware-ag/meteor-component-library": patch +--- + +Add focus state to banner close button diff --git a/.changeset/wise-squids-brush.md b/.changeset/wise-squids-brush.md new file mode 100644 index 000000000..c0ea228d9 --- /dev/null +++ b/.changeset/wise-squids-brush.md @@ -0,0 +1,5 @@ +--- +"@shopware-ag/meteor-component-library": patch +--- + +Announce mt-search as a real search input diff --git a/.changeset/yellow-melons-boil.md b/.changeset/yellow-melons-boil.md new file mode 100644 index 000000000..9e5bc9816 --- /dev/null +++ b/.changeset/yellow-melons-boil.md @@ -0,0 +1,5 @@ +--- +"@shopware-ag/meteor-component-library": patch +--- + +Remove link role from mt-link when using custom component diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 7bccc6782..06e9022ab 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -23,6 +23,11 @@ jobs: uses: actions/checkout@v4 with: ref: ${{ github.head_ref }} + if: ${{ github.event.pull_request.head.repo.full_name == 'shopware/meteor' }} + + - name: Checkout + uses: actions/checkout@v4 + if: ${{ github.event.pull_request.head.repo.full_name != 'shopware/meteor' }} - uses: pnpm/action-setup@v3 with: @@ -54,7 +59,7 @@ jobs: run: pnpx turbo run lint:types - name: Commit changes - if: always() + if: always() && ${{ github.event.pull_request.head.repo.full_name == 'shopware/meteor' }} uses: stefanzweifel/git-auto-commit-action@v5 with: commit_message: "Apply code formatting and fixable ESLint issues" @@ -160,12 +165,6 @@ jobs: name: nuxt-app--playwright-test-results path: examples/nuxt-app/test-results/ - - uses: actions/upload-artifact@v4 - if: always() - with: - name: meteor-admin-sdk--playwright-test-results - path: packages/admin-sdk/playwright-report/ - tested-versions: name: tested-versions runs-on: ubuntu-latest diff --git a/.github/workflows/visual-tests.yml b/.github/workflows/visual-tests.yml index e6379a605..18885c39d 100644 --- a/.github/workflows/visual-tests.yml +++ b/.github/workflows/visual-tests.yml @@ -55,14 +55,14 @@ jobs: run: | npx concurrently --kill-others --success first --names "SB,TEST" --hide "SB" --prefix-colors "magenta,blue" \ "http-server ./packages/component-library/storybook-static -a 127.0.0.1 --port 6006" \ - "wait-on http://127.0.0.1:6006 && pnpx turbo run test:storybook --filter=@shopware-ag/meteor-component-library" + "wait-on http://127.0.0.1:6006 && pnpx turbo run test:storybook --force --filter=@shopware-ag/meteor-component-library" - name: Run tests and update snapshots if: ${{ github.event_name == 'workflow_dispatch' }} run: | npx concurrently --kill-others --success first --names "SB,TEST" --hide "SB" --prefix-colors "magenta,blue" \ "http-server ./packages/component-library/storybook-static -a 127.0.0.1 --port 6006" \ - "wait-on http://127.0.0.1:6006 && pnpx turbo run test:storybook --filter=@shopware-ag/meteor-component-library -- -u" + "wait-on http://127.0.0.1:6006 && pnpx turbo run test:storybook --force --filter=@shopware-ag/meteor-component-library -- -u" - name: Archive visual test diffs uses: actions/upload-artifact@v4 diff --git a/examples/nuxt-app/tests/smoke.spec.ts-snapshots/renders-an-example-page-1-chromium-linux.png b/examples/nuxt-app/tests/smoke.spec.ts-snapshots/renders-an-example-page-1-chromium-linux.png index dcad20f7e..9e0eebd09 100644 Binary files a/examples/nuxt-app/tests/smoke.spec.ts-snapshots/renders-an-example-page-1-chromium-linux.png and b/examples/nuxt-app/tests/smoke.spec.ts-snapshots/renders-an-example-page-1-chromium-linux.png differ diff --git a/examples/nuxt-app/tests/smoke.spec.ts-snapshots/renders-an-example-page-1-firefox-linux.png b/examples/nuxt-app/tests/smoke.spec.ts-snapshots/renders-an-example-page-1-firefox-linux.png index 8fda603db..09252ee08 100644 Binary files a/examples/nuxt-app/tests/smoke.spec.ts-snapshots/renders-an-example-page-1-firefox-linux.png and b/examples/nuxt-app/tests/smoke.spec.ts-snapshots/renders-an-example-page-1-firefox-linux.png differ diff --git a/packages/component-library/.storybook/test-runner.ts b/packages/component-library/.storybook/test-runner.ts index 91b9d1ed1..00f5d94c8 100644 --- a/packages/component-library/.storybook/test-runner.ts +++ b/packages/component-library/.storybook/test-runner.ts @@ -1,3 +1,5 @@ +import type { TestRunnerConfig } from "@storybook/test-runner"; + const path = require("path"); const { toMatchImageSnapshot } = require("jest-image-snapshot"); @@ -51,4 +53,4 @@ module.exports = { customReceivedDir: customReceivedDir, }); }, -}; +} satisfies TestRunnerConfig; diff --git a/packages/component-library/__snapshots__/interaction-tests-form-mt-checkbox--visual-test-help-text-snap.png b/packages/component-library/__snapshots__/interaction-tests-form-mt-checkbox--visual-test-help-text-snap.png index 7f1f06e6f..be7d22120 100644 Binary files a/packages/component-library/__snapshots__/interaction-tests-form-mt-checkbox--visual-test-help-text-snap.png and b/packages/component-library/__snapshots__/interaction-tests-form-mt-checkbox--visual-test-help-text-snap.png differ diff --git a/packages/component-library/__snapshots__/interaction-tests-form-mt-colorpicker--visual-test-colorpicker-with-help-text-snap.png b/packages/component-library/__snapshots__/interaction-tests-form-mt-colorpicker--visual-test-colorpicker-with-help-text-snap.png index 9bdd0b218..648769239 100644 Binary files a/packages/component-library/__snapshots__/interaction-tests-form-mt-colorpicker--visual-test-colorpicker-with-help-text-snap.png and b/packages/component-library/__snapshots__/interaction-tests-form-mt-colorpicker--visual-test-colorpicker-with-help-text-snap.png differ diff --git a/packages/component-library/__snapshots__/interaction-tests-form-mt-switch--visual-test-help-text-snap.png b/packages/component-library/__snapshots__/interaction-tests-form-mt-switch--visual-test-help-text-snap.png index 499a5d8fc..8ab1177cf 100644 Binary files a/packages/component-library/__snapshots__/interaction-tests-form-mt-switch--visual-test-help-text-snap.png and b/packages/component-library/__snapshots__/interaction-tests-form-mt-switch--visual-test-help-text-snap.png differ diff --git a/packages/component-library/src/components/feedback-indicator/mt-banner/mt-banner.spec.ts b/packages/component-library/src/components/feedback-indicator/mt-banner/mt-banner.spec.ts new file mode 100644 index 000000000..a6de3464d --- /dev/null +++ b/packages/component-library/src/components/feedback-indicator/mt-banner/mt-banner.spec.ts @@ -0,0 +1,42 @@ +import { render, screen } from "@testing-library/vue"; +import userEvent from "@testing-library/user-event"; +import { vi } from "vitest"; +import MtBanner from "./mt-banner.vue"; + +describe("mt-banner", () => { + it("emits a close event when clicking on the close button", async () => { + // ARRANGE + const closeHandler = vi.fn(); + + render(MtBanner, { + props: { onClose: closeHandler, closable: true }, + }); + + // ACT + await userEvent.click(screen.getByRole("button", { name: /close/i })); + + // ASSERT + expect(closeHandler).toHaveBeenCalledOnce(); + expect(closeHandler).toHaveBeenCalledWith(undefined); + }); + + it("emits a close event with the bannerIndex when clicking on the close button", async () => { + // ARRANGE + const closeHandler = vi.fn(); + + render(MtBanner, { + props: { + onClose: closeHandler, + closable: true, + bannerIndex: "some-banner-index", + }, + }); + + // ACT + await userEvent.click(screen.getByRole("button", { name: /close/i })); + + // ASSERT + expect(closeHandler).toHaveBeenCalledOnce(); + expect(closeHandler).toHaveBeenCalledWith("some-banner-index"); + }); +}); diff --git a/packages/component-library/src/components/feedback-indicator/mt-banner/mt-banner.vue b/packages/component-library/src/components/feedback-indicator/mt-banner/mt-banner.vue index c93121fc5..14cccf354 100644 --- a/packages/component-library/src/components/feedback-indicator/mt-banner/mt-banner.vue +++ b/packages/component-library/src/components/feedback-indicator/mt-banner/mt-banner.vue @@ -3,7 +3,7 @@ (); + const bannerIcon = computed(() => { if (props.icon) return props.icon; @@ -100,16 +104,19 @@ const bodyClasses = computed(() => ({