This repository was archived by the owner on Jul 1, 2026. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy patheffectivePathsCategoryNames.test.ts
More file actions
99 lines (91 loc) · 3.64 KB
/
Copy patheffectivePathsCategoryNames.test.ts
File metadata and controls
99 lines (91 loc) · 3.64 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
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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
import { describe, expect, it } from 'vitest'
import {
categoryNameKey,
cleanEffectivePathsCategoryName,
findBotsWorkbook,
findCardsWorkbook,
findRelicsWorkbook,
findThemesWorkbook,
findWorkshopWorkbook,
findUwsWorkbook,
isBotsWorkbookName,
isUwsWorkbookName,
isCardsWorkbookName,
isRelicsWorkbookName,
isThemesWorkbookName,
isWorkshopWorkbookName,
} from './effectivePathsCategoryNames'
describe('categoryNameKey', () => {
it('strips leading emoji from IDS Master category labels', () => {
expect(categoryNameKey('🔮 Relics')).toBe('relics')
expect(categoryNameKey('Relics')).toBe('relics')
})
})
describe('cleanEffectivePathsCategoryName', () => {
it('drops ID suffix from Ultimate Weapon IDS row labels', () => {
expect(cleanEffectivePathsCategoryName('Ultimate Weapon ID')).toBe('Ultimate Weapons')
expect(cleanEffectivePathsCategoryName('Ultimate Weapons')).toBe('Ultimate Weapons')
expect(cleanEffectivePathsCategoryName('UWs v3.1.2')).toBe('Ultimate Weapons')
})
})
describe('findRelicsWorkbook', () => {
it('finds Relics among emoji-prefixed workbook names', () => {
const found = findRelicsWorkbook([
{ name: 'Laboratory', spreadsheetId: '1LaboratoryWorkbookIdXXXXXXX' },
{ name: '🔮 Relics', spreadsheetId: '1RelicsWorkbookIdXXXXXXXXXX' },
])
expect(found?.spreadsheetId).toBe('1RelicsWorkbookIdXXXXXXXXXX')
expect(isRelicsWorkbookName('🔮 Relics')).toBe(true)
})
})
describe('findThemesWorkbook', () => {
it('finds Themes & Songs among emoji-prefixed workbook names', () => {
const found = findThemesWorkbook([
{ name: 'Relics', spreadsheetId: '1RelicsWorkbookIdXXXXXXXXXX' },
{ name: '🎵 Themes & Songs', spreadsheetId: '1ThemesWorkbookIdXXXXXXXXX' },
])
expect(found?.spreadsheetId).toBe('1ThemesWorkbookIdXXXXXXXXX')
expect(isThemesWorkbookName('🎵 Themes & Songs')).toBe(true)
})
})
describe('findCardsWorkbook', () => {
it('finds Cards among emoji-prefixed workbook names', () => {
const found = findCardsWorkbook([
{ name: 'Relics', spreadsheetId: '1RelicsWorkbookIdXXXXXXXXXX' },
{ name: '🃏 Cards', spreadsheetId: '1CardsWorkbookIdXXXXXXXXXXXX' },
])
expect(found?.spreadsheetId).toBe('1CardsWorkbookIdXXXXXXXXXXXX')
expect(isCardsWorkbookName('🃏 Cards')).toBe(true)
})
})
describe('findWorkshopWorkbook', () => {
it('finds Workshop among emoji-prefixed workbook names', () => {
const found = findWorkshopWorkbook([
{ name: 'Laboratory', spreadsheetId: '1LaboratoryWorkbookIdXXXXXXX' },
{ name: '🔧 Workshop', spreadsheetId: '1WorkshopWorkbookIdXXXXXXXXX' },
])
expect(found?.spreadsheetId).toBe('1WorkshopWorkbookIdXXXXXXXXX')
expect(isWorkshopWorkbookName('🔧 Workshop')).toBe(true)
})
})
describe('findBotsWorkbook', () => {
it('finds Bots among emoji-prefixed workbook names', () => {
const found = findBotsWorkbook([
{ name: 'Workshop', spreadsheetId: '1WorkshopWorkbookIdXXXXXXXXX' },
{ name: '🤖 Bots', spreadsheetId: '1BotsWorkbookIdXXXXXXXXXXXXX' },
])
expect(found?.spreadsheetId).toBe('1BotsWorkbookIdXXXXXXXXXXXXX')
expect(isBotsWorkbookName('🤖 Bots')).toBe(true)
})
})
describe('findUwsWorkbook', () => {
it('finds UWs among versioned workbook names', () => {
const found = findUwsWorkbook([
{ name: 'Laboratory', spreadsheetId: '1LaboratoryWorkbookIdXXXXXXX' },
{ name: 'UWs v3.1.2', spreadsheetId: '1UwsWorkbookIdXXXXXXXXXXXXXX' },
])
expect(found?.spreadsheetId).toBe('1UwsWorkbookIdXXXXXXXXXXXXXX')
expect(isUwsWorkbookName('UWs v3.1.2')).toBe(true)
expect(isUwsWorkbookName('Ultimate Weapon')).toBe(true)
})
})