-
Notifications
You must be signed in to change notification settings - Fork 1
/
Lp.test.ts
77 lines (70 loc) · 2.11 KB
/
Lp.test.ts
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
import Lp from "../../src/class/Lp";
describe("existsLP", (): void => {
test("ランク名", (): void => {
const lp = new Lp("3", 1000, 1499, "スーパー ブロンズ", "SUPER BRONZE");
const text = `
【使用キャラ】ダルシム
【Lp】スーパー ブロンズ
【ルール】3先
`;
expect(lp.existsLP(text)).toBe(true);
});
test("ランク名略称", (): void => {
const lp = new Lp("6", 3000, 3499, "スーパー シルバー", "SUPER SILVER", ["スパシル"]);
const text = `
【使用キャラ】ダルシム
【Lp】スパシル
【ルール】3先
`;
expect(lp.existsLP(text)).toBe(true);
});
test("4桁 あり", (): void => {
const lp = new Lp("3", 1000, 1499, "スーパー ブロンズ", "SUPER BRONZE");
const text = `
【使用キャラ】ダルシム
【Lp】1200
【ルール】3先
【パス】1111
`;
expect(lp.existsLP(text)).toBe(true);
});
test("4桁 なし", (): void => {
const lp = new Lp("3", 1000, 1499, "スーパー ブロンズ", "SUPER BRONZE");
const text = `
【使用キャラ】ダルシム
【Lp】1500
【ルール】3先
【パス】1111
`;
expect(lp.existsLP(text)).toBe(false);
});
test("4桁 なし", (): void => {
const lp = new Lp("3", 1000, 1499, "スーパー ブロンズ", "SUPER BRONZE");
const text = `
【使用キャラ】ダルシム
【Lp】12000
【ルール】3先
【パス】1111
`;
expect(lp.existsLP(text)).toBe(false);
});
test("5桁 あり", (): void => {
const lp = new Lp("13", 12000, 13999, "ウルトラ プラチナ", "ULTRA PLATINUM", ["ウルプラ"]);
const text = `
【使用キャラ】ダルシム
【Lp】13000
【ルール】3先
【パス】3333
`;
expect(lp.existsLP(text)).toBe(true);
});
test("なし", (): void => {
const lp = new Lp("3", 1000, 1499, "スーパー ブロンズ", "SUPER BRONZE");
const text = `
【使用キャラ】ダルシム
【Lp】1
【ルール】3先
`;
expect(lp.existsLP(text)).toBe(false);
});
});