@salutejs/sdds-api-tests 0.33.0 → 0.33.2-canary.3335.41983928553.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.33.0",
3
+ "version": "0.33.2-canary.3335.41983928553.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.644.0",
17
- "@salutejs/plasma-giga": "0.371.0",
18
- "@salutejs/plasma-icons": "1.257.0",
19
- "@salutejs/plasma-web": "1.646.0",
20
- "@salutejs/sdds-bizcom": "0.376.0",
21
- "@salutejs/sdds-cs": "0.380.0",
22
- "@salutejs/sdds-dfa": "0.374.0",
23
- "@salutejs/sdds-finai": "0.367.0",
24
- "@salutejs/sdds-insol": "0.371.0",
25
- "@salutejs/sdds-netology": "0.375.0",
26
- "@salutejs/sdds-platform-ai": "0.375.0",
27
- "@salutejs/sdds-scan": "0.374.0",
28
- "@salutejs/sdds-serv": "0.375.0",
16
+ "@salutejs/plasma-b2c": "1.644.2-canary.3335.41983928553.0",
17
+ "@salutejs/plasma-giga": "0.371.2-canary.3335.41983928553.0",
18
+ "@salutejs/plasma-icons": "1.257.1-dev.0",
19
+ "@salutejs/plasma-web": "1.646.2-canary.3335.41983928553.0",
20
+ "@salutejs/sdds-bizcom": "0.376.2-canary.3335.41983928553.0",
21
+ "@salutejs/sdds-cs": "0.380.2-canary.3335.41983928553.0",
22
+ "@salutejs/sdds-dfa": "0.374.2-canary.3335.41983928553.0",
23
+ "@salutejs/sdds-finai": "0.367.2-canary.3335.41983928553.0",
24
+ "@salutejs/sdds-insol": "0.371.2-canary.3335.41983928553.0",
25
+ "@salutejs/sdds-netology": "0.375.2-canary.3335.41983928553.0",
26
+ "@salutejs/sdds-platform-ai": "0.375.2-canary.3335.41983928553.0",
27
+ "@salutejs/sdds-scan": "0.374.2-canary.3335.41983928553.0",
28
+ "@salutejs/sdds-serv": "0.375.2-canary.3335.41983928553.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": "efd41f41a4c5aba398fef6d8400d902385d17e74"
38
+ "gitHead": "72e6686d078597d75784fe3da11ff45804dd2bcf"
39
39
  }
@@ -0,0 +1,65 @@
1
+ import * as React from 'react';
2
+ import type { ComponentProps, ReactNode, CSSProperties, AriaRole } from 'react';
3
+ import { describe, it } from 'node:test';
4
+ import { expectTypeOf } from 'expect-type';
5
+ import { Group } from '@salutejs/plasma-b2c';
6
+
7
+ type GroupProps = ComponentProps<typeof Group>;
8
+
9
+ describe('Basics', () => {
10
+ it('Common', () => {
11
+ expectTypeOf<GroupProps>().toHaveProperty('children').toEqualTypeOf<ReactNode>();
12
+ expectTypeOf<GroupProps>().toHaveProperty('gap').toEqualTypeOf<'none' | 'dense' | 'wide' | undefined>();
13
+ expectTypeOf<GroupProps>().toHaveProperty('orientation').toEqualTypeOf<'vertical' | 'horizontal' | undefined>();
14
+ expectTypeOf<GroupProps>().toHaveProperty('shape').toEqualTypeOf<'default' | 'segmented' | undefined>();
15
+ expectTypeOf<GroupProps>().toHaveProperty('stretching').toEqualTypeOf<'filled' | 'auto' | undefined>();
16
+ });
17
+
18
+ it('HTMLDivElement', () => {
19
+ expectTypeOf<GroupProps>().toHaveProperty('id').toEqualTypeOf<string | undefined>();
20
+ expectTypeOf<GroupProps>().toHaveProperty('className').toEqualTypeOf<string | undefined>();
21
+ expectTypeOf<GroupProps>().toHaveProperty('style').toEqualTypeOf<CSSProperties | undefined>();
22
+ expectTypeOf<GroupProps>()
23
+ .toHaveProperty('onClick')
24
+ .toEqualTypeOf<React.MouseEventHandler<HTMLDivElement> | undefined>();
25
+ expectTypeOf<GroupProps>()
26
+ .toHaveProperty('onMouseEnter')
27
+ .toEqualTypeOf<React.MouseEventHandler<HTMLDivElement> | undefined>();
28
+ expectTypeOf<GroupProps>()
29
+ .toHaveProperty('onMouseLeave')
30
+ .toEqualTypeOf<React.MouseEventHandler<HTMLDivElement> | undefined>();
31
+ expectTypeOf<GroupProps>().toHaveProperty('aria-label').toEqualTypeOf<string | undefined>();
32
+ expectTypeOf<GroupProps>().toHaveProperty('role').toEqualTypeOf<AriaRole | undefined>();
33
+ });
34
+ });
35
+
36
+ describe('Complex', () => {
37
+ it('Examples', () => {
38
+ expectTypeOf<GroupProps>({ gap: 'dense', orientation: 'horizontal' });
39
+ expectTypeOf<GroupProps>({ shape: 'segmented', gap: 'none' });
40
+ expectTypeOf<GroupProps>({ stretching: 'filled', orientation: 'vertical', gap: 'wide' });
41
+ });
42
+ });
43
+
44
+ describe('Examples', () => {
45
+ it('Basic', () => {
46
+ () => {
47
+ return (
48
+ <Group gap="dense" orientation="horizontal" shape="default" stretching="auto">
49
+ <button type="button">One</button>
50
+ <button type="button">Two</button>
51
+ </Group>
52
+ );
53
+ };
54
+ });
55
+
56
+ it('Segmented', () => {
57
+ () => {
58
+ return (
59
+ <Group shape="segmented" gap="none" orientation="vertical" stretching="filled" aria-label="Группа">
60
+ <span>One</span>
61
+ </Group>
62
+ );
63
+ };
64
+ });
65
+ });