|
1 | | -import icons from '../src/icons'; |
| 1 | +import { getEventIcon, getNodeIcon, getNodeStatusIcon } from '../src/icons'; |
2 | 2 |
|
3 | 3 | describe('getNodeIcon', () => { |
4 | 4 | test('handles empty string', () => { |
5 | | - expect(icons.getNodeIcon('')).toBe('\ue616'); |
| 5 | + expect(getNodeIcon('')).toBe('\ue616'); |
6 | 6 | }); |
7 | 7 |
|
8 | 8 | test('handles string', () => { |
9 | | - expect(icons.getNodeIcon('cloudify.nodes.Compute')).toBe('\ue61b'); |
| 9 | + expect(getNodeIcon('cloudify.nodes.Compute')).toBe('\ue61b'); |
10 | 10 | }); |
11 | 11 |
|
12 | 12 | test('handles empty array', () => { |
13 | | - expect(icons.getNodeIcon([])).toBe('\ue616'); |
| 13 | + expect(getNodeIcon([])).toBe('\ue616'); |
14 | 14 | }); |
15 | 15 |
|
16 | 16 | test('handles array', () => { |
17 | | - expect(icons.getNodeIcon(['cloudify.nodes.Compute', 'cloudify.nodes.Root'])).toBe('\ue61b'); |
| 17 | + expect(getNodeIcon(['cloudify.nodes.Compute', 'cloudify.nodes.Root'])).toBe('\ue61b'); |
18 | 18 | }); |
19 | 19 |
|
20 | 20 | test('handles invalid input', () => { |
21 | | - expect(icons.getNodeIcon(555)).toBe('\ue616'); |
| 21 | + expect(getNodeIcon(555)).toBe('\ue616'); |
| 22 | + }); |
| 23 | +}); |
| 24 | + |
| 25 | +describe('getNodeStatusIcon', () => { |
| 26 | + test('handles empty string', () => { |
| 27 | + expect(getNodeStatusIcon('')).toBe(''); |
| 28 | + }); |
| 29 | + |
| 30 | + test('handles string', () => { |
| 31 | + expect(getNodeStatusIcon('alert')).toBe('\ue629'); |
| 32 | + }); |
| 33 | + |
| 34 | + test('handles invalid input', () => { |
| 35 | + expect(getNodeStatusIcon('abcd')).toBe(''); |
22 | 36 | }); |
23 | 37 | }); |
24 | 38 |
|
25 | 39 | describe('getEventIcon', () => { |
26 | 40 | test('handles empty string', () => { |
27 | | - expect(icons.getEventIcon('')).toBe('\ue60a'); |
| 41 | + expect(getEventIcon('')).toBe('\ue60a'); |
28 | 42 | }); |
29 | 43 |
|
30 | 44 | test('handles string', () => { |
31 | | - expect(icons.getEventIcon('task_succeeded')).toBe('\ue60b'); |
| 45 | + expect(getEventIcon('task_succeeded')).toBe('\ue60b'); |
32 | 46 | }); |
33 | 47 |
|
34 | 48 | test('handles invalid input', () => { |
35 | | - expect(icons.getEventIcon(555)).toBe('\ue60a'); |
| 49 | + expect(getEventIcon(555)).toBe('\ue60a'); |
36 | 50 | }); |
37 | 51 | }); |
0 commit comments