Archived
1
0
Fork 0
This repository has been archived on 2024-07-25. You can view files and clone it, but cannot push or open issues or pull requests.
paren/ren/attrs.test.ts

34 lines
754 B
TypeScript
Raw Normal View History

2022-05-22 00:03:48 +03:00
import { assertEquals } from "testing/asserts.ts";
import * as a from "./attrs.ts";
Deno.test({
name: "should return empty attrs object",
fn: () => {
assertEquals(a.classNames([]), {});
assertEquals(a.classNames([false, null, undefined]), {});
},
});
Deno.test({
name: "should return class attr",
fn: () => {
assertEquals(a.classNames(["hello"]), { class: "hello" });
assertEquals(a.classNames(["hello", "world"]), { class: "hello world" });
},
});
Deno.test({
name: "should return filter skipable and return class attr",
fn: () => {
assertEquals(
a.classNames([
null && "my",
undefined && "name",
"hello",
false && "world",
]),
{ class: "hello" },
);
},
});