-
Notifications
You must be signed in to change notification settings - Fork 4.5k
Expand file tree
/
Copy pathprofiles.test.ts
More file actions
63 lines (53 loc) · 2.01 KB
/
Copy pathprofiles.test.ts
File metadata and controls
63 lines (53 loc) · 2.01 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
import { describe, it, expect } from 'vitest';
import {
CORE_WORKFLOWS,
ALL_WORKFLOWS,
getProfileWorkflows,
} from '../../src/core/profiles.js';
describe('profiles', () => {
describe('CORE_WORKFLOWS', () => {
it('should contain the default core workflows', () => {
expect(CORE_WORKFLOWS).toEqual(['propose', 'explore', 'apply', 'sync', 'archive']);
});
it('should be a subset of ALL_WORKFLOWS', () => {
for (const workflow of CORE_WORKFLOWS) {
expect(ALL_WORKFLOWS).toContain(workflow);
}
});
});
describe('ALL_WORKFLOWS', () => {
it('should contain all 12 workflows', () => {
expect(ALL_WORKFLOWS).toHaveLength(12);
});
it('should contain expected workflow IDs', () => {
const expected = [
'propose', 'explore', 'new', 'continue', 'apply',
'ff', 'sync', 'archive', 'bulk-archive', 'verify', 'review', 'onboard',
];
expect([...ALL_WORKFLOWS]).toEqual(expected);
});
});
describe('getProfileWorkflows', () => {
it('should return core workflows for core profile', () => {
const result = getProfileWorkflows('core');
expect(result).toEqual(CORE_WORKFLOWS);
});
it('should return core workflows for core profile even if customWorkflows provided', () => {
const result = getProfileWorkflows('core', ['new', 'apply']);
expect(result).toEqual(CORE_WORKFLOWS);
});
it('should return custom workflows for custom profile', () => {
const customWorkflows = ['explore', 'new', 'apply', 'ff'];
const result = getProfileWorkflows('custom', customWorkflows);
expect(result).toEqual(customWorkflows);
});
it('should return empty array for custom profile with no customWorkflows', () => {
const result = getProfileWorkflows('custom');
expect(result).toEqual([]);
});
it('should return empty array for custom profile with empty customWorkflows', () => {
const result = getProfileWorkflows('custom', []);
expect(result).toEqual([]);
});
});
});