-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into feature/868
- Loading branch information
Showing
28 changed files
with
542 additions
and
212 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@shopware-ag/meteor-component-library": patch | ||
--- | ||
|
||
Add focus state to banner close button |
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,5 @@ | ||
--- | ||
"@shopware-ag/meteor-component-library": patch | ||
--- | ||
|
||
Announce mt-search as a real search input |
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,5 @@ | ||
--- | ||
"@shopware-ag/meteor-component-library": patch | ||
--- | ||
|
||
Remove link role from mt-link when using custom component |
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
Binary file modified
BIN
-1.22 KB
(96%)
...-app/tests/smoke.spec.ts-snapshots/renders-an-example-page-1-chromium-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-1.06 KB
(98%)
...t-app/tests/smoke.spec.ts-snapshots/renders-an-example-page-1-firefox-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
Binary file modified
BIN
+726 Bytes
(110%)
..._snapshots__/interaction-tests-form-mt-checkbox--visual-test-help-text-snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+727 Bytes
(110%)
...tion-tests-form-mt-colorpicker--visual-test-colorpicker-with-help-text-snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+711 Bytes
(110%)
.../__snapshots__/interaction-tests-form-mt-switch--visual-test-help-text-snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
42 changes: 42 additions & 0 deletions
42
packages/component-library/src/components/feedback-indicator/mt-banner/mt-banner.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,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"); | ||
}); | ||
}); |
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
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
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
51 changes: 51 additions & 0 deletions
51
packages/component-library/src/components/form/mt-help-text/mt-help-text.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,51 @@ | ||
import userEvent from "@testing-library/user-event"; | ||
import { render, screen } from "@testing-library/vue"; | ||
import MtHelpText from "./mt-help-text.vue"; | ||
import { flushPromises } from "@vue/test-utils"; | ||
|
||
describe("mt-help-text", () => { | ||
beforeEach(() => { | ||
vi.useFakeTimers(); | ||
}); | ||
|
||
afterEach(() => { | ||
vi.useFakeTimers(); | ||
}); | ||
|
||
it("opens a tooltip when focusing the help text", async () => { | ||
// ARRANGE | ||
render(MtHelpText, { | ||
props: { text: "Some text" }, | ||
}); | ||
|
||
const user = userEvent.setup({ | ||
advanceTimers: vi.advanceTimersByTime, | ||
}); | ||
|
||
// ACT | ||
await user.tab(); | ||
|
||
// ASSERT | ||
expect(screen.getByRole("tooltip")).toBeVisible(); | ||
}); | ||
|
||
it("opens a tooltip when hovering the help text", async () => { | ||
// ARRANGE | ||
render(MtHelpText, { | ||
props: { text: "Some text" }, | ||
}); | ||
|
||
const user = userEvent.setup({ | ||
advanceTimers: vi.advanceTimersByTime, | ||
}); | ||
|
||
// ACT | ||
await user.hover(screen.getByRole("button")); | ||
|
||
vi.advanceTimersByTime(550); | ||
await flushPromises(); | ||
|
||
// ASSERT | ||
expect(screen.getByRole("tooltip")).toBeVisible(); | ||
}); | ||
}); |
Oops, something went wrong.