@qoretechnologies/reqore 0.19.7 → 0.19.11

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.
Files changed (46) hide show
  1. package/.github/workflows/beta_release.yml +15 -5
  2. package/.github/workflows/tests.yml +9 -0
  3. package/.gitpod.yml +0 -14
  4. package/.jest-test-results.json +1 -0
  5. package/__tests__/button.test.tsx +116 -14
  6. package/__tests__/drawer.test.tsx +1 -6
  7. package/__tests__/menu.test.tsx +4 -12
  8. package/__tests__/tabs.test.tsx +40 -54
  9. package/build-storybook.log +3189 -0
  10. package/dist/components/Breadcrumbs/index.d.ts +1 -1
  11. package/dist/components/Breadcrumbs/index.d.ts.map +1 -1
  12. package/dist/components/Button/index.d.ts.map +1 -1
  13. package/dist/components/Button/index.js +17 -7
  14. package/dist/components/Button/index.js.map +1 -1
  15. package/dist/components/Drawer/index.d.ts +1 -1
  16. package/dist/components/Drawer/index.d.ts.map +1 -1
  17. package/dist/components/Drawer/index.js +41 -47
  18. package/dist/components/Drawer/index.js.map +1 -1
  19. package/dist/components/Dropdown/list.d.ts.map +1 -1
  20. package/dist/components/Dropdown/list.js +1 -1
  21. package/dist/components/Dropdown/list.js.map +1 -1
  22. package/dist/components/Menu/item.d.ts +1 -1
  23. package/dist/components/Menu/item.d.ts.map +1 -1
  24. package/dist/components/Panel/index.d.ts +1 -0
  25. package/dist/components/Panel/index.d.ts.map +1 -1
  26. package/dist/components/Panel/index.js +3 -2
  27. package/dist/components/Panel/index.js.map +1 -1
  28. package/dist/components/Tabs/content.d.ts +1 -1
  29. package/dist/components/Tabs/content.d.ts.map +1 -1
  30. package/dist/components/Tabs/index.d.ts +7 -4
  31. package/dist/components/Tabs/index.d.ts.map +1 -1
  32. package/dist/components/Tabs/index.js +6 -6
  33. package/dist/components/Tabs/index.js.map +1 -1
  34. package/dist/components/Tabs/item.d.ts +2 -1
  35. package/dist/components/Tabs/item.d.ts.map +1 -1
  36. package/dist/components/Tabs/item.js +23 -18
  37. package/dist/components/Tabs/item.js.map +1 -1
  38. package/dist/components/Tabs/list.d.ts +7 -17
  39. package/dist/components/Tabs/list.d.ts.map +1 -1
  40. package/dist/components/Tabs/list.js +4 -4
  41. package/dist/components/Tabs/list.js.map +1 -1
  42. package/dist/helpers/time.d.ts +6 -0
  43. package/dist/helpers/time.d.ts.map +1 -1
  44. package/dist/helpers/time.js +6 -0
  45. package/dist/helpers/time.js.map +1 -1
  46. package/package.json +12 -7
@@ -19,6 +19,8 @@ jobs:
19
19
  steps:
20
20
  # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
21
21
  - uses: actions/checkout@v2
22
+ with:
23
+ fetch-depth: 0
22
24
  - uses: actions/setup-node@v1
23
25
  with:
24
26
  node-version: 14.16.0
@@ -35,11 +37,19 @@ jobs:
35
37
  - name: Build
36
38
  id: build
37
39
  run: ./node_modules/.bin/tsc
38
- - name: Publish
39
- id: publish
40
- run: |
41
- ./node_modules/.bin/npm-cli-login -u ${{ secrets.NPM_USER }} -p '${{ secrets.NPM_PASSWORD }}' -e ${{ secrets.NPM_EMAIL }}
42
- npm publish --access public --tag beta
40
+ - name: Publish to NPM
41
+ id: npm_publish
42
+ uses: JS-DevTools/npm-publish@v1
43
+ with:
44
+ token: ${{ secrets.NPM_TOKEN }}
45
+ tag: beta
46
+ access: public
47
+ - name: Publish to Chromatic
48
+ id: chromatic_publish
49
+ uses: chromaui/action@v1
50
+ with:
51
+ token: ${{ secrets.GITHUB_TOKEN }}
52
+ projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }}
43
53
  - name: Create a release
44
54
  id: release
45
55
  uses: actions/create-release@v1
@@ -20,6 +20,8 @@ jobs:
20
20
  steps:
21
21
  # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
22
22
  - uses: actions/checkout@v2
23
+ with:
24
+ fetch-depth: 0
23
25
  - uses: actions/setup-node@v1
24
26
  with:
25
27
  node-version: 14.16.0
@@ -38,6 +40,13 @@ jobs:
38
40
  - name: Running tests
39
41
  id: tests
40
42
  run: yarn test:ci
43
+ - name: Publish to Chromatic
44
+ id: chromatic_publish
45
+ uses: chromaui/action@v1
46
+ with:
47
+ token: ${{ secrets.GITHUB_TOKEN }}
48
+ projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }}
49
+ exitZeroOnChanges: true
41
50
  - name: Slack notification
42
51
  uses: Foxhoundn/slack@v1.2.94
43
52
  with:
package/.gitpod.yml CHANGED
@@ -1,17 +1,3 @@
1
- vscode:
2
- extensions:
3
- - oderwat.indent-rainbow
4
- - tombonnike.vscode-status-bar-format-toggle
5
- - usernamehw.errorlens
6
- - emmanuelbeziat.vscode-great-icons
7
- - esbenp.prettier-vscode
8
- - jpoissonnier.vscode-styled-components
9
- - streetsidesoftware.code-spell-checker
10
- - foxhoundn.synthax
11
- - alefragnani.bookmarks
12
- - tabnine.tabnine-vscode
13
- - akosyakov.gitpod-monitor
14
- - eamodio.gitlens
15
1
  tasks:
16
2
  - init: "yarn install"
17
3
  - command: "yarn storybook"
@@ -0,0 +1 @@
1
+ {"numFailedTestSuites":0,"numFailedTests":0,"numPassedTestSuites":2,"numPassedTests":12,"numPendingTestSuites":0,"numPendingTests":0,"numRuntimeErrorTestSuites":0,"numTodoTests":0,"numTotalTestSuites":2,"numTotalTests":12,"openHandles":[],"snapshot":{"added":0,"didUpdate":false,"failure":false,"filesAdded":0,"filesRemoved":0,"filesRemovedList":[],"filesUnmatched":0,"filesUpdated":0,"matched":0,"total":0,"unchecked":0,"uncheckedKeysByFile":[],"unmatched":0,"updated":0},"startTime":1640860411341,"success":true,"testResults":[{"assertionResults":[{"ancestorTitles":[],"failureMessages":[],"fullName":"Renders <Button /> properly","location":null,"status":"passed","title":"Renders <Button /> properly"},{"ancestorTitles":[],"failureMessages":[],"fullName":"Renders <Button /> with size properly","location":null,"status":"passed","title":"Renders <Button /> with size properly"},{"ancestorTitles":[],"failureMessages":[],"fullName":"Renders <Button /> with icon properly","location":null,"status":"passed","title":"Renders <Button /> with icon properly"},{"ancestorTitles":[],"failureMessages":[],"fullName":"Renders <Button /> with intent properly","location":null,"status":"passed","title":"Renders <Button /> with intent properly"},{"ancestorTitles":[],"failureMessages":[],"fullName":"Renders <Button /> with right icon properly","location":null,"status":"passed","title":"Renders <Button /> with right icon properly"},{"ancestorTitles":[],"failureMessages":[],"fullName":"Renders <Button /> with icon and right icon properly","location":null,"status":"passed","title":"Renders <Button /> with icon and right icon properly"},{"ancestorTitles":[],"failureMessages":[],"fullName":"Renders <Button /> with onClick function","location":null,"status":"passed","title":"Renders <Button /> with onClick function"}],"endTime":1640860416953,"message":"","name":"/workspace/reqore/__tests__/button.test.tsx","startTime":1640860412163,"status":"passed","summary":""},{"assertionResults":[{"ancestorTitles":[],"failureMessages":[],"fullName":"Does not render <Drawer /> if not open","location":null,"status":"passed","title":"Does not render <Drawer /> if not open"},{"ancestorTitles":[],"failureMessages":[],"fullName":"Renders opened <Drawer /> properly","location":null,"status":"passed","title":"Renders opened <Drawer /> properly"},{"ancestorTitles":[],"failureMessages":[],"fullName":"Renders hidable <Drawer /> properly","location":null,"status":"passed","title":"Renders hidable <Drawer /> properly"},{"ancestorTitles":[],"failureMessages":[],"fullName":"Renders closable <Drawer /> properly","location":null,"status":"passed","title":"Renders closable <Drawer /> properly"},{"ancestorTitles":[],"failureMessages":[],"fullName":"Renders <Drawer /> with interactive backdrop","location":null,"status":"passed","title":"Renders <Drawer /> with interactive backdrop"}],"endTime":1640860417371,"message":"","name":"/workspace/reqore/__tests__/drawer.test.tsx","startTime":1640860412108,"status":"passed","summary":""}],"wasInterrupted":false}
@@ -1,24 +1,126 @@
1
- import { render } from "@testing-library/react";
2
- import React from "react";
3
- import {
4
- ReqoreButton,
5
- ReqoreContent,
6
- ReqoreLayoutContent,
7
- ReqoreUIProvider
8
- } from "../src";
9
-
10
- test("Renders <Button /> properly", () => {
1
+ import { fireEvent, render } from '@testing-library/react';
2
+ import React from 'react';
3
+ import { ReqoreButton, ReqoreContent, ReqoreLayoutContent, ReqoreUIProvider } from '../src';
4
+
5
+ test('Renders <Button /> properly', () => {
6
+ render(
7
+ <ReqoreUIProvider>
8
+ <ReqoreLayoutContent>
9
+ <ReqoreContent>
10
+ <ReqoreButton minimal>Hello</ReqoreButton>
11
+ <ReqoreButton icon='4KFill'>Another</ReqoreButton>
12
+ </ReqoreContent>
13
+ </ReqoreLayoutContent>
14
+ </ReqoreUIProvider>
15
+ );
16
+
17
+ expect(document.querySelectorAll('.reqore-icon').length).toBe(1);
18
+ expect(document.querySelectorAll('.reqore-button').length).toBe(2);
19
+ });
20
+
21
+ test('Renders <Button /> with size properly', () => {
22
+ render(
23
+ <ReqoreUIProvider>
24
+ <ReqoreLayoutContent>
25
+ <ReqoreContent>
26
+ <ReqoreButton size='tiny'>Tiny</ReqoreButton>
27
+ <ReqoreButton size='small'>Small</ReqoreButton>
28
+ <ReqoreButton size='big'>Big</ReqoreButton>
29
+ <ReqoreButton size='huge'>Huge</ReqoreButton>
30
+ </ReqoreContent>
31
+ </ReqoreLayoutContent>
32
+ </ReqoreUIProvider>
33
+ );
34
+
35
+ expect(document.querySelectorAll('.reqore-button').length).toBe(4);
36
+ });
37
+
38
+ test('Renders <Button /> with icon properly', () => {
39
+ render(
40
+ <ReqoreUIProvider>
41
+ <ReqoreLayoutContent>
42
+ <ReqoreContent>
43
+ <ReqoreButton icon='4KFill'>4K</ReqoreButton>
44
+ <ReqoreButton icon='24HoursFill'>24</ReqoreButton>
45
+ <ReqoreButton icon='BallPenFill'>Pen</ReqoreButton>
46
+ </ReqoreContent>
47
+ </ReqoreLayoutContent>
48
+ </ReqoreUIProvider>
49
+ );
50
+
51
+ expect(document.querySelectorAll('.reqore-icon').length).toBe(3);
52
+ expect(document.querySelectorAll('.reqore-button').length).toBe(3);
53
+ });
54
+
55
+ test('Renders <Button /> with intent properly', () => {
11
56
  render(
12
57
  <ReqoreUIProvider>
13
58
  <ReqoreLayoutContent>
14
59
  <ReqoreContent>
15
- <ReqoreButton minimal>Hello</ReqoreButton>
16
- <ReqoreButton icon="4KFill">Another</ReqoreButton>
60
+ <ReqoreButton intent='pending'>Pending</ReqoreButton>
61
+ <ReqoreButton intent='info'>Info</ReqoreButton>
62
+ <ReqoreButton intent='success'>Success</ReqoreButton>
63
+ <ReqoreButton intent='warning'>Warning</ReqoreButton>
64
+ <ReqoreButton intent='danger'>Danger</ReqoreButton>
65
+ </ReqoreContent>
66
+ </ReqoreLayoutContent>
67
+ </ReqoreUIProvider>
68
+ );
69
+
70
+ expect(document.querySelectorAll('.reqore-button').length).toBe(5);
71
+ });
72
+
73
+ test('Renders <Button /> with right icon properly', () => {
74
+ render(
75
+ <ReqoreUIProvider>
76
+ <ReqoreLayoutContent>
77
+ <ReqoreContent>
78
+ <ReqoreButton rightIcon='4KFill'>4K</ReqoreButton>
79
+ <ReqoreButton rightIcon='24HoursFill'>24</ReqoreButton>
80
+ <ReqoreButton rightIcon='BallPenFill'>Pen</ReqoreButton>
81
+ </ReqoreContent>
82
+ </ReqoreLayoutContent>
83
+ </ReqoreUIProvider>
84
+ );
85
+
86
+ expect(document.querySelectorAll('.reqore-button').length).toBe(3);
87
+ });
88
+
89
+ test('Renders <Button /> with icon and right icon properly', () => {
90
+ render(
91
+ <ReqoreUIProvider>
92
+ <ReqoreLayoutContent>
93
+ <ReqoreContent>
94
+ <ReqoreButton icon='4KFill' rightIcon='24HoursFill'>
95
+ 4K
96
+ </ReqoreButton>
97
+ <ReqoreButton icon='24HoursFill' rightIcon='BallPenFill'>
98
+ 24
99
+ </ReqoreButton>
100
+ <ReqoreButton icon='BallPenFill' rightIcon='4KFill'>
101
+ Pen
102
+ </ReqoreButton>
103
+ </ReqoreContent>
104
+ </ReqoreLayoutContent>
105
+ </ReqoreUIProvider>
106
+ );
107
+
108
+ expect(document.querySelectorAll('.reqore-button').length).toBe(3);
109
+ });
110
+
111
+ // A test that tests the onClick function of the button using fireEvent
112
+ test('Renders <Button /> with onClick function', () => {
113
+ const onClick = jest.fn();
114
+ const { getAllByText } = render(
115
+ <ReqoreUIProvider>
116
+ <ReqoreLayoutContent>
117
+ <ReqoreContent>
118
+ <ReqoreButton onClick={onClick}>Click</ReqoreButton>
17
119
  </ReqoreContent>
18
120
  </ReqoreLayoutContent>
19
121
  </ReqoreUIProvider>
20
122
  );
21
123
 
22
- expect(document.querySelectorAll(".reqore-icon").length).toBe(1);
23
- expect(document.querySelectorAll(".reqore-button").length).toBe(2);
124
+ fireEvent.click(getAllByText('Click')[0]);
125
+ expect(onClick).toHaveBeenCalledTimes(1);
24
126
  });
@@ -1,11 +1,6 @@
1
1
  import { fireEvent, render } from '@testing-library/react';
2
2
  import React from 'react';
3
- import {
4
- ReqoreContent,
5
- ReqoreDrawer,
6
- ReqoreLayoutContent,
7
- ReqoreUIProvider,
8
- } from '../src';
3
+ import { ReqoreContent, ReqoreDrawer, ReqoreLayoutContent, ReqoreUIProvider } from '../src';
9
4
 
10
5
  test('Does not render <Drawer /> if not open', () => {
11
6
  render(
@@ -1,11 +1,6 @@
1
1
  import { fireEvent, render } from '@testing-library/react';
2
2
  import React from 'react';
3
- import {
4
- ReqoreMenu,
5
- ReqoreMenuDivider,
6
- ReqoreMenuItem,
7
- ReqoreUIProvider,
8
- } from '../src/index';
3
+ import { ReqoreMenu, ReqoreMenuDivider, ReqoreMenuItem, ReqoreUIProvider } from '../src/index';
9
4
 
10
5
  test('Renders <Menu /> properly', () => {
11
6
  render(
@@ -14,13 +9,14 @@ test('Renders <Menu /> properly', () => {
14
9
  <ReqoreMenuItem> Item 1 </ReqoreMenuItem>
15
10
  <ReqoreMenuItem> Item 2 </ReqoreMenuItem>
16
11
  <ReqoreMenuDivider label='Divider' />
12
+ <ReqoreMenuItem label={2.5} />
17
13
  <ReqoreMenuItem> Item 3 </ReqoreMenuItem>
18
14
  <ReqoreMenuItem> Item 4 </ReqoreMenuItem>
19
15
  </ReqoreMenu>
20
16
  </ReqoreUIProvider>
21
17
  );
22
18
 
23
- expect(document.querySelectorAll('.reqore-menu-item').length).toBe(4);
19
+ expect(document.querySelectorAll('.reqore-menu-item').length).toBe(5);
24
20
  expect(document.querySelectorAll('.reqore-menu-divider').length).toBe(1);
25
21
  });
26
22
 
@@ -52,11 +48,7 @@ test('<Menu /> item has right clickable button', () => {
52
48
  <ReqoreUIProvider>
53
49
  <ReqoreMenu>
54
50
  <ReqoreMenuItem> Item 1 </ReqoreMenuItem>
55
- <ReqoreMenuItem
56
- onClick={itemCb}
57
- rightIcon='24HoursFill'
58
- onRightIconClick={iconCb}
59
- >
51
+ <ReqoreMenuItem onClick={itemCb} rightIcon='24HoursFill' onRightIconClick={iconCb}>
60
52
  Item 2
61
53
  </ReqoreMenuItem>
62
54
  <ReqoreMenuDivider label='Divider' />
@@ -1,11 +1,6 @@
1
1
  import { act, fireEvent, render, screen } from '@testing-library/react';
2
2
  import React, { useState } from 'react';
3
- import {
4
- ReqoreLayoutContent,
5
- ReqoreTabs,
6
- ReqoreTabsContent,
7
- ReqoreUIProvider,
8
- } from '../src';
3
+ import { ReqoreLayoutContent, ReqoreTabs, ReqoreTabsContent, ReqoreUIProvider } from '../src';
9
4
 
10
5
  test('Renders full <Tabs /> properly', () => {
11
6
  render(
@@ -21,11 +16,11 @@ test('Renders full <Tabs /> properly', () => {
21
16
  { label: 'Tab 5', icon: 'Home3Line', id: 'tab5' },
22
17
  ]}
23
18
  >
24
- <ReqoreTabsContent id='tab1'>Tab 1 content</ReqoreTabsContent>
25
- <ReqoreTabsContent id='tab2'>Tab 2 content</ReqoreTabsContent>
26
- <ReqoreTabsContent id='tab3'>Tab 3 content</ReqoreTabsContent>
27
- <ReqoreTabsContent id='tab4'>Tab 4 content</ReqoreTabsContent>
28
- <ReqoreTabsContent id='tab5'>Tab 5 content</ReqoreTabsContent>
19
+ <ReqoreTabsContent tabId='tab1'>Tab 1 content</ReqoreTabsContent>
20
+ <ReqoreTabsContent tabId='tab2'>Tab 2 content</ReqoreTabsContent>
21
+ <ReqoreTabsContent tabId='tab3'>Tab 3 content</ReqoreTabsContent>
22
+ <ReqoreTabsContent tabId='tab4'>Tab 4 content</ReqoreTabsContent>
23
+ <ReqoreTabsContent tabId='tab5'>Tab 5 content</ReqoreTabsContent>
29
24
  </ReqoreTabs>
30
25
  </ReqoreLayoutContent>
31
26
  </ReqoreUIProvider>
@@ -54,11 +49,11 @@ test('Renders shortened <Tabs /> properly', () => {
54
49
  { label: 'Tab 5', icon: 'Home3Line', id: 'tab5' },
55
50
  ]}
56
51
  >
57
- <ReqoreTabsContent id='tab1'>Tab 1 content</ReqoreTabsContent>
58
- <ReqoreTabsContent id='tab2'>Tab 2 content</ReqoreTabsContent>
59
- <ReqoreTabsContent id='tab3'>Tab 3 content</ReqoreTabsContent>
60
- <ReqoreTabsContent id='tab4'>Tab 4 content</ReqoreTabsContent>
61
- <ReqoreTabsContent id='tab5'>Tab 5 content</ReqoreTabsContent>
52
+ <ReqoreTabsContent tabId='tab1'>Tab 1 content</ReqoreTabsContent>
53
+ <ReqoreTabsContent tabId='tab2'>Tab 2 content</ReqoreTabsContent>
54
+ <ReqoreTabsContent tabId='tab3'>Tab 3 content</ReqoreTabsContent>
55
+ <ReqoreTabsContent tabId='tab4'>Tab 4 content</ReqoreTabsContent>
56
+ <ReqoreTabsContent tabId='tab5'>Tab 5 content</ReqoreTabsContent>
62
57
  </ReqoreTabs>
63
58
  </ReqoreLayoutContent>
64
59
  </ReqoreUIProvider>
@@ -66,10 +61,7 @@ test('Renders shortened <Tabs /> properly', () => {
66
61
  });
67
62
 
68
63
  expect(document.querySelectorAll('.reqore-tabs-list-item').length).toBe(2);
69
- expect(
70
- document.querySelectorAll('.reqore-tabs-list .reqore-popover-wrapper')
71
- .length
72
- ).toBe(1);
64
+ expect(document.querySelectorAll('.reqore-tabs-list .reqore-popover-wrapper').length).toBe(1);
73
65
  });
74
66
 
75
67
  test('Default active tab can be specified', () => {
@@ -87,11 +79,11 @@ test('Default active tab can be specified', () => {
87
79
  ]}
88
80
  activeTab='tab4'
89
81
  >
90
- <ReqoreTabsContent id='tab1'>Tab 1 content</ReqoreTabsContent>
91
- <ReqoreTabsContent id='tab2'>Tab 2 content</ReqoreTabsContent>
92
- <ReqoreTabsContent id='tab3'>Tab 3 content</ReqoreTabsContent>
93
- <ReqoreTabsContent id='tab4'>Tab 4 content</ReqoreTabsContent>
94
- <ReqoreTabsContent id='tab5'>Tab 5 content</ReqoreTabsContent>
82
+ <ReqoreTabsContent tabId='tab1'>Tab 1 content</ReqoreTabsContent>
83
+ <ReqoreTabsContent tabId='tab2'>Tab 2 content</ReqoreTabsContent>
84
+ <ReqoreTabsContent tabId='tab3'>Tab 3 content</ReqoreTabsContent>
85
+ <ReqoreTabsContent tabId='tab4'>Tab 4 content</ReqoreTabsContent>
86
+ <ReqoreTabsContent tabId='tab5'>Tab 5 content</ReqoreTabsContent>
95
87
  </ReqoreTabs>
96
88
  </ReqoreLayoutContent>
97
89
  </ReqoreUIProvider>
@@ -118,11 +110,11 @@ test('Changes tab and runs callback', () => {
118
110
  ]}
119
111
  onTabChange={cb}
120
112
  >
121
- <ReqoreTabsContent id='tab1'>Tab 1 content</ReqoreTabsContent>
122
- <ReqoreTabsContent id='tab2'>Tab 2 content</ReqoreTabsContent>
123
- <ReqoreTabsContent id='tab3'>Tab 3 content</ReqoreTabsContent>
124
- <ReqoreTabsContent id='tab4'>Tab 4 content</ReqoreTabsContent>
125
- <ReqoreTabsContent id='tab5'>Tab 5 content</ReqoreTabsContent>
113
+ <ReqoreTabsContent tabId='tab1'>Tab 1 content</ReqoreTabsContent>
114
+ <ReqoreTabsContent tabId='tab2'>Tab 2 content</ReqoreTabsContent>
115
+ <ReqoreTabsContent tabId='tab3'>Tab 3 content</ReqoreTabsContent>
116
+ <ReqoreTabsContent tabId='tab4'>Tab 4 content</ReqoreTabsContent>
117
+ <ReqoreTabsContent tabId='tab5'>Tab 5 content</ReqoreTabsContent>
126
118
  </ReqoreTabs>
127
119
  </ReqoreLayoutContent>
128
120
  </ReqoreUIProvider>
@@ -133,9 +125,7 @@ test('Changes tab and runs callback', () => {
133
125
 
134
126
  expect(screen.getByText('Tab 3 content')).toBeTruthy();
135
127
  expect(cb).toHaveBeenCalledWith('tab3');
136
- expect(
137
- document.querySelectorAll('.reqore-tabs-list-item__active').length
138
- ).toBe(1);
128
+ expect(document.querySelectorAll('.reqore-tabs-list-item__active').length).toBe(1);
139
129
  });
140
130
 
141
131
  test('Does not change tab and run callback when disabled', () => {
@@ -155,11 +145,11 @@ test('Does not change tab and run callback when disabled', () => {
155
145
  ]}
156
146
  onTabChange={cb}
157
147
  >
158
- <ReqoreTabsContent id='tab1'>Tab 1 content</ReqoreTabsContent>
159
- <ReqoreTabsContent id='tab2'>Tab 2 content</ReqoreTabsContent>
160
- <ReqoreTabsContent id='tab3'>Tab 3 content</ReqoreTabsContent>
161
- <ReqoreTabsContent id='tab4'>Tab 4 content</ReqoreTabsContent>
162
- <ReqoreTabsContent id='tab5'>Tab 5 content</ReqoreTabsContent>
148
+ <ReqoreTabsContent tabId='tab1'>Tab 1 content</ReqoreTabsContent>
149
+ <ReqoreTabsContent tabId='tab2'>Tab 2 content</ReqoreTabsContent>
150
+ <ReqoreTabsContent tabId='tab3'>Tab 3 content</ReqoreTabsContent>
151
+ <ReqoreTabsContent tabId='tab4'>Tab 4 content</ReqoreTabsContent>
152
+ <ReqoreTabsContent tabId='tab5'>Tab 5 content</ReqoreTabsContent>
163
153
  </ReqoreTabs>
164
154
  </ReqoreLayoutContent>
165
155
  </ReqoreUIProvider>
@@ -170,9 +160,7 @@ test('Does not change tab and run callback when disabled', () => {
170
160
 
171
161
  expect(screen.getByText('Tab 1 content')).toBeTruthy();
172
162
  expect(cb).not.toHaveBeenCalled();
173
- expect(
174
- document.querySelectorAll('.reqore-tabs-list-item__active').length
175
- ).toBe(1);
163
+ expect(document.querySelectorAll('.reqore-tabs-list-item__active').length).toBe(1);
176
164
  });
177
165
 
178
166
  test('Changes tab programatically and runs callback', () => {
@@ -195,15 +183,13 @@ test('Changes tab programatically and runs callback', () => {
195
183
  onTabChange={cb}
196
184
  activeTab={activeTab}
197
185
  >
198
- <ReqoreTabsContent id='tab1'>
199
- <button onClick={() => setActiveTab('tab2')}>
200
- Change active tab
201
- </button>
186
+ <ReqoreTabsContent tabId='tab1'>
187
+ <button onClick={() => setActiveTab('tab2')}>Change active tab</button>
202
188
  </ReqoreTabsContent>
203
- <ReqoreTabsContent id='tab2'>Tab 2 content</ReqoreTabsContent>
204
- <ReqoreTabsContent id='tab3'>Tab 3 content</ReqoreTabsContent>
205
- <ReqoreTabsContent id='tab4'>Tab 4 content</ReqoreTabsContent>
206
- <ReqoreTabsContent id='tab5'>Tab 5 content</ReqoreTabsContent>
189
+ <ReqoreTabsContent tabId='tab2'>Tab 2 content</ReqoreTabsContent>
190
+ <ReqoreTabsContent tabId='tab3'>Tab 3 content</ReqoreTabsContent>
191
+ <ReqoreTabsContent tabId='tab4'>Tab 4 content</ReqoreTabsContent>
192
+ <ReqoreTabsContent tabId='tab5'>Tab 5 content</ReqoreTabsContent>
207
193
  </ReqoreTabs>
208
194
  </ReqoreLayoutContent>
209
195
  </ReqoreUIProvider>
@@ -242,11 +228,11 @@ test('Closable tab can be closed if not disabled', () => {
242
228
  ]}
243
229
  onTabChange={cb}
244
230
  >
245
- <ReqoreTabsContent id='tab1'>Tab 1 content</ReqoreTabsContent>
246
- <ReqoreTabsContent id='tab2'>Tab 2 content</ReqoreTabsContent>
247
- <ReqoreTabsContent id='tab3'>Tab 3 content</ReqoreTabsContent>
248
- <ReqoreTabsContent id='tab4'>Tab 4 content</ReqoreTabsContent>
249
- <ReqoreTabsContent id='tab5'>Tab 5 content</ReqoreTabsContent>
231
+ <ReqoreTabsContent tabId='tab1'>Tab 1 content</ReqoreTabsContent>
232
+ <ReqoreTabsContent tabId='tab2'>Tab 2 content</ReqoreTabsContent>
233
+ <ReqoreTabsContent tabId='tab3'>Tab 3 content</ReqoreTabsContent>
234
+ <ReqoreTabsContent tabId='tab4'>Tab 4 content</ReqoreTabsContent>
235
+ <ReqoreTabsContent tabId='tab5'>Tab 5 content</ReqoreTabsContent>
250
236
  </ReqoreTabs>
251
237
  </ReqoreLayoutContent>
252
238
  </ReqoreUIProvider>