|
1 | | -import { mod, getArrayLabel, toNumber, castArray } from './index'; |
| 1 | +import { getArrayLabel } from './index'; |
2 | 2 | import { SchemaField } from '@stac-manager/data-core'; |
3 | 3 |
|
4 | | -describe('mod', () => { |
5 | | - it('should return the correct positive remainder', () => { |
6 | | - expect(mod(5, 3)).toBe(2); |
7 | | - }); |
8 | | - |
9 | | - it('should handle negative dividends correctly', () => { |
10 | | - expect(mod(-1, 3)).toBe(2); |
11 | | - }); |
12 | | - |
13 | | - it('should handle zero divisor correctly', () => { |
14 | | - expect(mod(0, 3)).toBe(0); |
15 | | - }); |
16 | | -}); |
17 | | - |
18 | 4 | describe('getArrayLabel', () => { |
19 | 5 | it('should return a label with a number suffix for string labels', () => { |
20 | 6 | const field: SchemaField = { label: 'Label' } as any; |
@@ -52,27 +38,3 @@ describe('getArrayLabel', () => { |
52 | 38 | expect(result?.formatted).toMatchSnapshot(); |
53 | 39 | }); |
54 | 40 | }); |
55 | | - |
56 | | -describe('toNumber', () => { |
57 | | - it('should convert valid numbers correctly', () => { |
58 | | - expect(toNumber('42')).toBe(42); |
59 | | - expect(toNumber(42)).toBe(42); |
60 | | - }); |
61 | | - |
62 | | - it('should return null for invalid numbers', () => { |
63 | | - expect(toNumber('abc')).toBeNull(); |
64 | | - expect(toNumber(undefined)).toBeNull(); |
65 | | - }); |
66 | | -}); |
67 | | - |
68 | | -describe('castArray', () => { |
69 | | - it('should wrap non-array values in an array', () => { |
70 | | - expect(castArray(42)).toEqual([42]); |
71 | | - expect(castArray('test')).toEqual(['test']); |
72 | | - }); |
73 | | - |
74 | | - it('should return the same array if input is already an array', () => { |
75 | | - expect(castArray([42])).toEqual([42]); |
76 | | - expect(castArray(['test'])).toEqual(['test']); |
77 | | - }); |
78 | | -}); |
0 commit comments