-
-
Notifications
You must be signed in to change notification settings - Fork 266
Expand file tree
/
Copy pathindex.test.ts
More file actions
58 lines (49 loc) · 2.23 KB
/
index.test.ts
File metadata and controls
58 lines (49 loc) · 2.23 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
/**
* Tests for session-management workflow metadata
*/
import { describe, it, expect } from 'vitest';
import { workflow } from '../index.ts';
describe('session-management workflow metadata', () => {
describe('Workflow Structure', () => {
it('should export workflow object with required properties', () => {
expect(workflow).toHaveProperty('name');
expect(workflow).toHaveProperty('description');
expect(workflow).toHaveProperty('platforms');
expect(workflow).toHaveProperty('targets');
expect(workflow).toHaveProperty('capabilities');
});
it('should have correct workflow name', () => {
expect(workflow.name).toBe('session-management');
});
it('should have correct description', () => {
expect(workflow.description).toBe(
'Manage session defaults for projectPath/workspacePath, scheme, configuration, simulatorName/simulatorId, deviceId, useLatestOS and arch. These defaults are required by many tools and must be set before attempting to call tools that would depend on these values.',
);
});
it('should have correct platforms array', () => {
expect(workflow.platforms).toEqual(['iOS', 'macOS', 'tvOS', 'watchOS', 'visionOS']);
});
it('should have correct targets array', () => {
expect(workflow.targets).toEqual(['simulator', 'device']);
});
it('should have correct capabilities array', () => {
expect(workflow.capabilities).toEqual(['configuration', 'state-management']);
});
});
describe('Workflow Validation', () => {
it('should have valid string properties', () => {
expect(typeof workflow.name).toBe('string');
expect(typeof workflow.description).toBe('string');
expect(workflow.name.length).toBeGreaterThan(0);
expect(workflow.description.length).toBeGreaterThan(0);
});
it('should have valid array properties', () => {
expect(Array.isArray(workflow.platforms)).toBe(true);
expect(Array.isArray(workflow.targets)).toBe(true);
expect(Array.isArray(workflow.capabilities)).toBe(true);
expect(workflow.platforms.length).toBeGreaterThan(0);
expect(workflow.targets.length).toBeGreaterThan(0);
expect(workflow.capabilities.length).toBeGreaterThan(0);
});
});
});