-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathTerrain.test.ts
More file actions
52 lines (49 loc) · 1.43 KB
/
Terrain.test.ts
File metadata and controls
52 lines (49 loc) · 1.43 KB
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
/**
* @vitest-environment happy-dom
*/
import { render } from "@testing-library/svelte";
import { describe, expect, it } from "vitest";
import WithData from "../WithData.svelte";
import { CBNData } from "../data";
import Terrain from "./Terrain.svelte";
describe("Terrain", () => {
it("shows deconstruction methods and required tools for advanced terrain removal", () => {
const data = new CBNData([
{
type: "construction_group",
id: "advanced_object_deconstruction",
name: "Advanced Object Deconstruction",
},
{
type: "tool_quality",
id: "SCREW",
name: "screw driving",
},
{
type: "construction",
id: "constr_remove_t_console",
group: "advanced_object_deconstruction",
category: "OTHER",
time: "20 m",
required_skills: [["electronics", 0]],
qualities: [{ id: "SCREW", level: 1 }],
pre_terrain: "t_console",
pre_special: "check_deconstruct",
},
{
type: "terrain",
id: "t_console",
name: "console",
description: "A test console.",
},
]);
const { getByText } = render(WithData, {
Component: Terrain,
data,
item: data.byId("terrain", "t_console"),
});
expect(getByText("Deconstruction")).toBeTruthy();
expect(getByText("Tools Required")).toBeTruthy();
expect(getByText("screw driving")).toBeTruthy();
});
});