Skip to content

Commit 8de301c

Browse files
committed
added tests
1 parent 8a5d853 commit 8de301c

File tree

1 file changed

+20
-1
lines changed

1 file changed

+20
-1
lines changed

tests/unit/util/tags.spec.js

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { isHtmlTag, isTransition } from "@/util/tags";
1+
import { isHtmlTag, isTransition, isHtmlAttribute } from "@/util/tags";
22

33
describe("isHtmlTag", () => {
44
test.each([
@@ -17,6 +17,25 @@ describe("isHtmlTag", () => {
1717
)
1818
});
1919

20+
describe("isHtmlAttribute", () => {
21+
test.each([
22+
["class", true],
23+
["id", true],
24+
["role", true],
25+
["data-whatever", true],
26+
["aria-whatever", true],
27+
["notattribute", false],
28+
["href", false],
29+
["name", false],
30+
])(
31+
"for %s returns %s",
32+
(value, expected) =>{
33+
const actual = isHtmlAttribute(value);
34+
expect(actual).toEqual(expected);
35+
}
36+
)
37+
});
38+
2039
describe("isTransition", () => {
2140
test.each([
2241
["TransitionGroup", true],

0 commit comments

Comments
 (0)