diff --git a/docs/partials/api.md b/docs/partials/api.md index 1c2c031..696208f 100644 --- a/docs/partials/api.md +++ b/docs/partials/api.md @@ -276,7 +276,7 @@ The `shape` attribute accepts three values: `rounded`, `pill`, or `circle`. ### Using role="button" -Aside from the standard hyperlink use-case, the `auro-hyperlink` element is intended to be used for button situations as illustrated below. Assuming the role of button, `auro-hyperlink` also will track the `aria-pressed` state. +Aside from the standard hyperlink use-case, the `auro-hyperlink` element is intended to be used for button situations as illustrated below. **Note:** Any `href` will be ignored when using `role="button"`. A click-event must be passed to the element as illustrated in the example below. diff --git a/src/auro-hyperlink.js b/src/auro-hyperlink.js index e253f03..9186e72 100644 --- a/src/auro-hyperlink.js +++ b/src/auro-hyperlink.js @@ -131,7 +131,6 @@ export class AuroHyperlink extends ComponentBase { { expect(anchor).to.have.attribute("role", "button"); expect(anchor).to.have.attribute("tabindex", "0"); - expect(anchor).to.have.attribute("aria-pressed", "false"); expect(anchor).to.have.class("hyperlink--button"); expect(anchor).not.to.have.attribute("href"); }); @@ -26,11 +25,10 @@ describe("auro-hyperlink", () => { `); const anchor = el.shadowRoot.querySelector("a"); + const regex = /^http:\/\/localhost:\d+\/auro$/; + const match = regex.test(anchor.href); - console.log(anchor.href); - - expect(anchor).to.have.attribute("href", "http://localhost:8000/auro"); - expect(anchor).not.to.have.attribute("href", "/auro"); + expect(match).to.be.true; }); it("auro-hyperlink href is absolute URL", async () => {