File size: 564 Bytes
0ad74ed
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
import { test, describe, assert, afterEach, vi } from "vitest";
import { cleanup, render } from "@self/tootils";

import Group from "./Index.svelte";

describe("Group", () => {
	afterEach(() => {
		cleanup();
	});

	test("setting visible to false hides the Group", async () => {
		render(Group, {
			elem_id: "group",
			visible: false
		});

		const groupElement = document.getElementById("group");

		assert(groupElement !== null, "Group element not found.");
		assert(
			groupElement.classList.contains("hide"),
			"Group element is not hidden."
		);
	});
});