UNPKG

748 BTypeScriptView Raw
1import React from "react";
2
3import { app } from "@/test/elements";
4import { render } from "@/test/render";
5
6import { ContainerAttributes } from "./ContainerAttributes";
7
8beforeEach(() => {
9 render(
10 <div role="application">
11 <ContainerAttributes />
12 </div>
13 );
14});
15
16test('should have the "id" attribute', () => {
17 expect(app().firstChild).toHaveAttribute("id", "testId");
18});
19
20test('should have the "title" attribute', () => {
21 expect(app().firstChild).toHaveAttribute("title", "foo_title");
22});
23
24test('should have the "lang" attribute', () => {
25 expect(app().firstChild).toHaveAttribute("lang", "it");
26});
27
28test("should have the data set attribute", () => {
29 expect(app().firstChild).toHaveAttribute("data-test", "testData");
30});