Source code

Revision control

Copy as Markdown

Other Tools

/* Any copyright is dedicated to the Public Domain.
"use strict";
// Test utils.
const expect = require("expect");
const { render } = require("enzyme");
const {
createFactory,
// Components under test.
const ConsoleApiCall = createFactory(
);
const ConsoleCmd = createFactory(
);
const EvaluationResult = createFactory(
);
const {
ConsoleCommand,
// Test fakes.
const {
stubPreparedMessages,
describe("message types component ARIA:", () => {
describe("ConsoleAPICall", () => {
it("sets aria-live to polite", () => {
const message = stubPreparedMessages.get("console.log('foobar', 'test')");
const wrapper = render(ConsoleApiCall({ message, serviceContainer }));
expect(wrapper.attr("aria-live")).toBe("polite");
});
});
describe("EvaluationResult", () => {
it("sets aria-live to polite", () => {
const message = stubPreparedMessages.get("asdf()");
const wrapper = render(EvaluationResult({ message, serviceContainer }));
expect(wrapper.attr("aria-live")).toBe("polite");
});
});
describe("ConsoleCommand", () => {
it("sets aria-live to off", () => {
const message = new ConsoleCommand({
messageText: `"simple"`,
});
const wrapper = render(ConsoleCmd({ message, serviceContainer }));
expect(wrapper.attr("aria-live")).toBe("off");
});
});
});