@salutejs/sdds-api-tests 0.12.0-next-sbcom.0 → 0.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@salutejs/sdds-api-tests",
|
|
3
|
-
"version": "0.12.0
|
|
3
|
+
"version": "0.12.0",
|
|
4
4
|
"description": "API tests for components",
|
|
5
5
|
"author": "Salute Frontend Team <salute.developers@gmail.com>",
|
|
6
6
|
"license": "MIT",
|
|
@@ -13,19 +13,19 @@
|
|
|
13
13
|
"test": "rm -rf tests && node script.mjs && NODE_OPTIONS=--max-old-space-size=8192 tsc --noEmit -p ./tsconfig.typecheck.json"
|
|
14
14
|
},
|
|
15
15
|
"devDependencies": {
|
|
16
|
-
"@salutejs/plasma-b2c": "1.623.0
|
|
17
|
-
"@salutejs/plasma-giga": "0.350.0
|
|
18
|
-
"@salutejs/plasma-icons": "1.241.0
|
|
19
|
-
"@salutejs/plasma-web": "1.625.0
|
|
20
|
-
"@salutejs/sdds-bizcom": "0.355.0
|
|
21
|
-
"@salutejs/sdds-cs": "0.359.0
|
|
22
|
-
"@salutejs/sdds-dfa": "0.353.0
|
|
23
|
-
"@salutejs/sdds-finai": "0.346.0
|
|
24
|
-
"@salutejs/sdds-insol": "0.350.0
|
|
25
|
-
"@salutejs/sdds-netology": "0.354.0
|
|
26
|
-
"@salutejs/sdds-platform-ai": "0.354.0
|
|
27
|
-
"@salutejs/sdds-scan": "0.353.0
|
|
28
|
-
"@salutejs/sdds-serv": "0.354.0
|
|
16
|
+
"@salutejs/plasma-b2c": "1.623.0",
|
|
17
|
+
"@salutejs/plasma-giga": "0.350.0",
|
|
18
|
+
"@salutejs/plasma-icons": "1.241.0",
|
|
19
|
+
"@salutejs/plasma-web": "1.625.0",
|
|
20
|
+
"@salutejs/sdds-bizcom": "0.355.0",
|
|
21
|
+
"@salutejs/sdds-cs": "0.359.0",
|
|
22
|
+
"@salutejs/sdds-dfa": "0.353.0",
|
|
23
|
+
"@salutejs/sdds-finai": "0.346.0",
|
|
24
|
+
"@salutejs/sdds-insol": "0.350.0",
|
|
25
|
+
"@salutejs/sdds-netology": "0.354.0",
|
|
26
|
+
"@salutejs/sdds-platform-ai": "0.354.0",
|
|
27
|
+
"@salutejs/sdds-scan": "0.353.0",
|
|
28
|
+
"@salutejs/sdds-serv": "0.354.0",
|
|
29
29
|
"@types/node": "^25.9.1",
|
|
30
30
|
"@types/react": "18.0.28",
|
|
31
31
|
"@types/react-dom": "18.0.11",
|
|
@@ -35,5 +35,5 @@
|
|
|
35
35
|
"publishConfig": {
|
|
36
36
|
"access": "public"
|
|
37
37
|
},
|
|
38
|
-
"gitHead": "
|
|
38
|
+
"gitHead": "22cd4c680b11c65c8abe88d14e6c8c37af778906"
|
|
39
39
|
}
|
|
@@ -14,7 +14,7 @@ describe('Basics', () => {
|
|
|
14
14
|
expectTypeOf<PopoverProps>().toHaveProperty('offset').toEqualTypeOf<[number, number] | undefined>();
|
|
15
15
|
expectTypeOf<PopoverProps>()
|
|
16
16
|
.toHaveProperty('frame')
|
|
17
|
-
.toEqualTypeOf<string | RefObject<HTMLElement> | undefined>();
|
|
17
|
+
.toEqualTypeOf<string | RefObject<HTMLElement | null> | undefined>();
|
|
18
18
|
expectTypeOf<PopoverProps>().toHaveProperty('hasArrow').toEqualTypeOf<boolean | undefined>();
|
|
19
19
|
expectTypeOf<PopoverProps>().toHaveProperty('zIndex').toEqualTypeOf<string | undefined>();
|
|
20
20
|
expectTypeOf<PopoverProps>().toHaveProperty('preventOverflow').toEqualTypeOf<boolean | undefined>();
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import type { ComponentProps, ReactNode } from 'react';
|
|
3
|
+
import { describe, it } from 'node:test';
|
|
4
|
+
import { expectTypeOf } from 'expect-type';
|
|
5
|
+
// @ts-ignore
|
|
6
|
+
import { TimePicker } from '@salutejs/plasma-b2c';
|
|
7
|
+
|
|
8
|
+
import type { TimePickerMultiplicity } from '../../../../../../../packages/plasma-new-hope/src/components/TimePickerGrid/TimePickerGrid.types';
|
|
9
|
+
|
|
10
|
+
type Props = ComponentProps<typeof TimePicker>;
|
|
11
|
+
|
|
12
|
+
describe('Basics', () => {
|
|
13
|
+
it('Common', () => {
|
|
14
|
+
expectTypeOf<Props>().toHaveProperty('value').toEqualTypeOf<string | undefined>();
|
|
15
|
+
expectTypeOf<Props>().toHaveProperty('disabled').toEqualTypeOf<boolean | undefined>();
|
|
16
|
+
expectTypeOf<Props>().toHaveProperty('readonly').toEqualTypeOf<boolean | undefined>();
|
|
17
|
+
expectTypeOf<Props>().toHaveProperty('stretched').toEqualTypeOf<boolean | undefined>();
|
|
18
|
+
expectTypeOf<Props>().toHaveProperty('size').toEqualTypeOf<string | undefined>();
|
|
19
|
+
expectTypeOf<Props>().toHaveProperty('view').toEqualTypeOf<string | undefined>();
|
|
20
|
+
expectTypeOf<Props>().toHaveProperty('label').toEqualTypeOf<string | undefined>();
|
|
21
|
+
expectTypeOf<Props>().toHaveProperty('placeholder').toEqualTypeOf<string | undefined>();
|
|
22
|
+
expectTypeOf<Props>().toHaveProperty('contentLeft').toEqualTypeOf<ReactNode>();
|
|
23
|
+
expectTypeOf<Props>().toHaveProperty('contentRight').toEqualTypeOf<ReactNode>();
|
|
24
|
+
expectTypeOf<Props>().toHaveProperty('columnsQuantity').toEqualTypeOf<2 | 3 | undefined>();
|
|
25
|
+
expectTypeOf<Props>().toHaveProperty('multiplicityMinutes').toEqualTypeOf<TimePickerMultiplicity | undefined>();
|
|
26
|
+
expectTypeOf<Props>().toHaveProperty('multiplicitySeconds').toEqualTypeOf<TimePickerMultiplicity | undefined>();
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
it('Variations', () => {
|
|
30
|
+
type View = NonNullable<Props['view']>;
|
|
31
|
+
expectTypeOf<View>().toExtend<string>();
|
|
32
|
+
expectTypeOf<string>().not.toExtend<View>();
|
|
33
|
+
});
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
describe('Examples', () => {
|
|
37
|
+
it('Basic', () => {
|
|
38
|
+
() => {
|
|
39
|
+
void (<TimePicker value="00:00" size="m" />);
|
|
40
|
+
void (<TimePicker value="00:00:00" columnsQuantity={3} />);
|
|
41
|
+
};
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
it('Multiplicity minutes and seconds', () => {
|
|
45
|
+
() => {
|
|
46
|
+
void (<TimePicker value="00:00" multiplicityMinutes={5} />);
|
|
47
|
+
void (<TimePicker value="00:00:00" multiplicityMinutes={15} />);
|
|
48
|
+
void (<TimePicker value="00:00:00" multiplicitySeconds={20} />);
|
|
49
|
+
void (
|
|
50
|
+
<TimePicker value="00:00:00" columnsQuantity={3} multiplicityMinutes={15} multiplicitySeconds={20} />
|
|
51
|
+
);
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
// Negative cases
|
|
55
|
+
// @ts-expect-error - 7 is not a valid multiplicity value
|
|
56
|
+
expectTypeOf<Props>({ value: '00:00', multiplicityMinutes: 7 });
|
|
57
|
+
|
|
58
|
+
// @ts-expect-error - 8 is not a valid multiplicity value
|
|
59
|
+
expectTypeOf<Props>({ value: '00:00', multiplicitySeconds: 8 });
|
|
60
|
+
});
|
|
61
|
+
});
|