diff --git a/viewer/package.json b/viewer/package.json index 69f6439d..8dd3aeb0 100644 --- a/viewer/package.json +++ b/viewer/package.json @@ -1,6 +1,6 @@ { "name": "@gaia-project/viewer", - "version": "5.20.46", + "version": "5.20.47", "description": "Functions to visualize the map and boards for gaia project inside html canvas", "contributors": [ "coyotte508", diff --git a/viewer/src/components/Commands.spec.ts b/viewer/src/components/Commands.spec.ts index 10ea634b..735ed759 100644 --- a/viewer/src/components/Commands.spec.ts +++ b/viewer/src/components/Commands.spec.ts @@ -258,9 +258,12 @@ describe("Commands", () => { await fireEvent.click(buttonWithText("Location 1")!); await Vue.nextTick(); - const labels = visibleButtons().map((button) => button.textContent?.trim() ?? ""); - expect(labels.some((label) => label.includes("8vp,q"))).to.equal(true); - expect(labels.some((label) => label.includes("8vp,8c"))).to.equal(true); + for (const reward of ["8vp,q", "8vp,8c"]) { + const button = visibleButtons().find((button) => button.getAttribute("aria-label")?.includes(reward)); + expect(button).to.not.equal(undefined); + expect(button.querySelector(".federationTile")).to.not.equal(null); + expect(button.textContent).not.to.include("Federation"); + } } finally { (window as any).matchMedia = previousMatchMedia; } @@ -309,7 +312,7 @@ describe("Commands", () => { expect(okButton, "the confirmation must identify the tapped location").to.not.equal(undefined); await okButton!.trigger("click"); await Vue.nextTick(); - await buttonWithText("7vp,2o")!.trigger("click"); + await wrapper.find('button[aria-label*="7vp,2o"]').trigger("click"); await Vue.nextTick(); const emitted = wrapper.emitted("command"); @@ -389,7 +392,7 @@ describe("Commands", () => { .wrappers.find((entry) => entry.isVisible() && entry.text().includes(text))!; await button("End Selection").trigger("click"); await Vue.nextTick(); - await button("7vp,2o").trigger("click"); + await wrapper.find('button[aria-label*="7vp,2o"]').trigger("click"); await Vue.nextTick(); expect(wrapper.emitted("command")![0][0]).to.equal("terrans federation 1A9 fed4"); } finally { diff --git a/viewer/src/components/MoveButton.vue b/viewer/src/components/MoveButton.vue index 6fdf123a..d31361b7 100644 --- a/viewer/src/components/MoveButton.vue +++ b/viewer/src/components/MoveButton.vue @@ -8,7 +8,7 @@ @mouseenter="hover" @mouseleave="leave" :title="button.tooltip || (button.mobileIcon ? button.label : undefined)" - :aria-label="button.mobileIcon ? button.label : undefined" + :aria-label="button.ariaLabel || (button.mobileIcon ? button.label : undefined)" v-b-tooltip.html="{ boundary: 'viewport' }" >