-
Notifications
You must be signed in to change notification settings - Fork 14
WIP: BC-10453 Minor a11y fixes #3847
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
sebmue-dataport
wants to merge
16
commits into
main
Choose a base branch
from
BC-10453-a11y-fixes
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 15 commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
2fea27d
add focus trap to board layout dialog
sebmue-dataport b4005d1
Merge branch 'main' into BC-10416-focus
sebmue-dataport c59c520
replace legacy usage of $t with t for i18n
sebmue-dataport 922c82b
fix keyboard handling in Roop Copy Info Dialog
sebmue-dataport 09c30ec
use v-for for list items
sebmue-dataport f849f59
WIP: refactor ShareModal
sebmue-dataport d5d1d8d
WIP: remove Custom Dialog usage from Sahre Modal
sebmue-dataport 00032c6
fix displaying step 1 before share dialog is fully closed
sebmue-dataport 21870c4
WIP: adjust tests
sebmue-dataport 70b8f96
WIP: fix tests
sebmue-dataport 527766f
wip: try to fix tests
sebmue-dataport 8957ad3
wip: modify tests
sebmue-dataport ce78506
fix ShareModal unit tests
sebmue-dataport 39de9d2
fix more tests
sebmue-dataport 165edef
Merge remote-tracking branch 'origin/main' into BC-10453-a11y-fixes
sebmue-dataport 8ac042e
Merge remote-tracking branch 'origin/main' into BC-10453-a11y-fixes
NFriedo File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 |
|---|---|---|
| @@ -1,4 +1,3 @@ | ||
| import vCustomDialog from "@/components/organisms/vCustomDialog.vue"; | ||
| import ShareModalOptionsForm from "@/components/share/ShareModalOptionsForm.vue"; | ||
| import ShareModalResult from "@/components/share/ShareModalResult.vue"; | ||
| import { ShareTokenBodyParamsParentTypeEnum } from "@/serverApi/v3"; | ||
|
|
@@ -12,6 +11,8 @@ import { | |
| } from "@@/tests/test-utils/setup"; | ||
| import { mount } from "@vue/test-utils"; | ||
| import ShareModal from "./ShareModal.vue"; | ||
| import { VDialog } from "vuetify/components/VDialog"; | ||
| import { nextTick } from "vue"; | ||
|
|
||
| describe("@/components/share/ShareModal", () => { | ||
| let shareModuleMock: ShareModule; | ||
|
|
@@ -25,6 +26,7 @@ describe("@/components/share/ShareModal", () => { | |
| [SHARE_MODULE_KEY.valueOf()]: shareModuleMock, | ||
| [NOTIFIER_MODULE_KEY.valueOf()]: notifierModuleMock, | ||
| }, | ||
| stubs: { UseFocusTrap: true }, | ||
| }, | ||
| props: { | ||
| type: ShareTokenBodyParamsParentTypeEnum.Courses, | ||
|
|
@@ -57,40 +59,65 @@ describe("@/components/share/ShareModal", () => { | |
|
|
||
| it("should have the correct title", () => { | ||
| const { wrapper } = setup(); | ||
| const title = wrapper.vm.$refs.textTitle as HTMLElement; | ||
| const title = wrapper.findComponent({ name: "v-card-title" }); | ||
|
|
||
| expect(title.textContent).toContain( | ||
| "components.molecules.share.options.title" | ||
| ); | ||
| expect(title.text()).toContain("components.molecules.share.options.title"); | ||
| }); | ||
|
|
||
| it("should call 'createShareUrl' store method when next button clicked", () => { | ||
| const { wrapper } = setup(); | ||
| const dialog = wrapper.findComponent(vCustomDialog); | ||
| const dialog = wrapper.findComponent(VDialog); | ||
|
|
||
| const buttons = dialog.findAllComponents({ | ||
| name: "v-btn", | ||
| props: { variant: "flat" }, | ||
| }); | ||
| expect(buttons.length).toBe(2); | ||
| expect(buttons[0].text()).toBe("common.actions.cancel"); | ||
| expect(buttons[1].text()).toBe("common.actions.continue"); | ||
|
|
||
| dialog.vm.$emit("next"); | ||
| buttons[1].vm.$emit("click"); | ||
|
|
||
| expect(shareModuleMock.createShareUrl).toHaveBeenCalled(); | ||
| }); | ||
|
|
||
| it("should call 'resetShareFlow' store method when dialog closed", () => { | ||
| const { wrapper } = setup(); | ||
| const dialog = wrapper.findComponent(vCustomDialog); | ||
| const dialog = wrapper.findComponent(VDialog); | ||
|
|
||
| dialog.vm.$emit("dialog-closed"); | ||
| dialog.vm.$emit("after-leave"); | ||
|
|
||
| expect(shareModuleMock.resetShareFlow).toHaveBeenCalled(); | ||
| }); | ||
|
|
||
| it("should call 'resetShareFlow' store method when sub component emits 'done'", () => { | ||
| it("should return the component state to firstStep when dialog closes", () => { | ||
| const { wrapper } = setup(); | ||
| const dialog = wrapper.findComponent(VDialog); | ||
|
|
||
| expect((wrapper.vm as unknown as typeof ShareModal).step).toBe("firstStep"); | ||
|
|
||
| (wrapper.vm as unknown as typeof ShareModal).onNext(); | ||
| expect((wrapper.vm as unknown as typeof ShareModal).step).toBe( | ||
| "secondStep" | ||
| ); | ||
|
|
||
| dialog.vm.$emit("after-leave"); | ||
| wrapper.vm.$nextTick(); | ||
| expect((wrapper.vm as unknown as typeof ShareModal).step).toBe("firstStep"); | ||
| }); | ||
|
|
||
| it("should call 'resetShareFlow' store method when sub component emits 'done'", async () => { | ||
| shareModuleMock = createModuleMocks(ShareModule, { | ||
| getIsShareModalOpen: true, | ||
| getParentType: ShareTokenBodyParamsParentTypeEnum.Courses, | ||
| getShareUrl: "http://example.com", | ||
| }); | ||
| const { wrapper } = setup(); | ||
| const form = wrapper.findComponent(ShareModalResult); | ||
|
|
||
| (wrapper.vm as unknown as typeof ShareModal).step = "secondStep"; | ||
| await nextTick(); | ||
|
|
||
| const form = wrapper.findComponent(ShareModalResult); | ||
| form.vm.$emit("done"); | ||
|
|
||
| expect(shareModuleMock.resetShareFlow).toHaveBeenCalled(); | ||
|
|
@@ -108,32 +135,33 @@ describe("@/components/share/ShareModal", () => { | |
| ).toStrictEqual(payload); | ||
| }); | ||
|
|
||
| it("should call 'onCopy' method when sub component emits 'copied'", async () => { | ||
| it("should call 'onCopy' method when 'onNext' is called'", async () => { | ||
| shareModuleMock = createModuleMocks(ShareModule, { | ||
| getIsShareModalOpen: true, | ||
| getParentType: ShareTokenBodyParamsParentTypeEnum.Courses, | ||
| getShareUrl: "http://example.com", | ||
| }); | ||
| const { wrapper } = setup(); | ||
|
|
||
| (wrapper.vm as unknown as typeof ShareModal).onNext(); | ||
| await wrapper.vm.$nextTick(); | ||
|
|
||
| const form = wrapper.findComponent(ShareModalResult); | ||
|
|
||
| form.vm.$emit("copied"); | ||
| expect(notifierModuleMock.show).toHaveBeenCalled(); | ||
| }); | ||
|
|
||
| describe("ctl tool info", () => { | ||
| it("should have the correct title", () => { | ||
| it("should have the correct title", async () => { | ||
| const { wrapper } = setup(); | ||
|
|
||
| const dialog = wrapper.findComponent(vCustomDialog); | ||
| const cardText = dialog.findComponent({ name: "v-card-text" }); | ||
|
|
||
| const cardText = wrapper.findComponent({ name: "v-card-text" }); | ||
| const infotext = cardText.find( | ||
| `[data-testid="share-modal-external-tools-info"]` | ||
| ); | ||
|
|
||
| expect(infotext.isVisible()).toBe(true); | ||
|
||
| expect(infotext.text()).toEqual( | ||
| expect(infotext.text()).toContain( | ||
| "components.molecules.shareImport.options.ctlTools.infoText.unavailable" | ||
| ); | ||
| }); | ||
|
|
||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please check if other usages of VCustomDialog need to be refactored to this type, too.