Skip to content

Extended/full rulesets cause "Not implemented: window.computedStyle(elt, pseudoElt)" Error #534

Description

@FedeAbella

Running tests using the extended or full rulesets when some components are present, causes multiple Not implemented: window.computedStyle(elt, pseudoElt) errors to be shown via console.error. This does not happen with the base ruleset.

Environment:

node v18.15.0
@salesforce/sfdx-lwc-jest v1.3.0
@sa11y/jest@5.0.1

Testing Component:
Markup:

<template>
  <form action="#">
    <input type="button" id="fail1InputButtonName" />
  </form>
</template>

Javascript:

import { LightningElement } from "lwc";

export default class TestSa11y2 extends LightningElement {}

Test:

import { createElement } from "lwc";
import TestSa11y2 from "c/testSa11y2";

describe("c-test-sa11-y2", () => {
  afterEach(() => {
    while (document.body.firstChild) {
      document.body.removeChild(document.body.firstChild);
    }
  });

  it("Tests input-button-name", async () => {
    const element = createElement("c-test-sa11-y2", {
      is: TestSa11y2
    });
    document.body.appendChild(element);

    await expect(element).not.toBeAccessible();
  });
});

Test Results:
Using extended ruleset (process.env.SA11Y_RULESET = "extended" in setupEnvVars.js) (test result file)
Using base ruleset (process.env.SA11Y_RULESET = "base" in setupEnvVars.js) (test result file)

Expected Behaviour: Changing rulesets should not cause errors.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions