@squiz/resource-browser 1.39.1-alpha.0 → 1.39.1-alpha.10
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": "@squiz/resource-browser",
|
3
|
-
"version": "1.39.1-alpha.
|
3
|
+
"version": "1.39.1-alpha.10",
|
4
4
|
"main": "lib/index.js",
|
5
5
|
"types": "lib/index.d.ts",
|
6
6
|
"scripts": {
|
@@ -15,8 +15,8 @@
|
|
15
15
|
},
|
16
16
|
"dependencies": {
|
17
17
|
"@mui/icons-material": "5.11.16",
|
18
|
-
"@squiz/dx-json-schema-lib": "1.39.1-alpha.
|
19
|
-
"@squiz/generic-browser-lib": "1.39.1-alpha.
|
18
|
+
"@squiz/dx-json-schema-lib": "1.39.1-alpha.10",
|
19
|
+
"@squiz/generic-browser-lib": "1.39.1-alpha.10",
|
20
20
|
"pretty-bytes": "5.6.0",
|
21
21
|
"react-aria": "3.23.1",
|
22
22
|
"react-responsive": "9.0.2",
|
@@ -74,5 +74,5 @@
|
|
74
74
|
"volta": {
|
75
75
|
"node": "18.15.0"
|
76
76
|
},
|
77
|
-
"gitHead": "
|
77
|
+
"gitHead": "0087495957856a1d1b15227f3a450c6261ad5c5a"
|
78
78
|
}
|
@@ -1,6 +1,6 @@
|
|
1
1
|
/* eslint-disable @typescript-eslint/no-empty-function */
|
2
2
|
import React from 'react';
|
3
|
-
import { screen, render, waitFor, within } from '@testing-library/react';
|
3
|
+
import { screen, render, waitFor, within, act } from '@testing-library/react';
|
4
4
|
import userEvent from '@testing-library/user-event';
|
5
5
|
import { mockResource, mockSource } from '../__mocks__/MockModels';
|
6
6
|
import { Resource, Source, Hierarchy } from '../types';
|
@@ -175,8 +175,10 @@ describe('ResourcePickerContainer', () => {
|
|
175
175
|
mockResource({ id: '3', name: 'Test Page 3' }),
|
176
176
|
]);
|
177
177
|
|
178
|
-
|
179
|
-
|
178
|
+
const { getAllByText } = await act(async () => {
|
179
|
+
// Component has finished initial render
|
180
|
+
return render(<ResourcePickerContainer {...baseProps} onRequestChildren={onRequestChildren} />);
|
181
|
+
});
|
180
182
|
await waitFor(() => {
|
181
183
|
expect(getAllByText('Test system')[0]).toBeInTheDocument();
|
182
184
|
});
|
@@ -198,10 +200,12 @@ describe('ResourcePickerContainer', () => {
|
|
198
200
|
])(
|
199
201
|
'Selecting a node on %s shows its properties in the details panel',
|
200
202
|
async (description: string, width: number, expectedPreviewPanelCloseButtons: number) => {
|
201
|
-
|
202
|
-
|
203
|
-
<
|
204
|
-
|
203
|
+
await act(async () =>
|
204
|
+
render(
|
205
|
+
<ResponsiveContext.Provider value={{ width }}>
|
206
|
+
<ResourcePickerContainer {...baseProps} />
|
207
|
+
</ResponsiveContext.Provider>,
|
208
|
+
),
|
205
209
|
);
|
206
210
|
await waitFor(() => {
|
207
211
|
expect(screen.getByRole('button', { name: 'Drill down to Test Website children' })).toBeInTheDocument();
|
@@ -393,7 +397,7 @@ describe('ResourcePickerContainer', () => {
|
|
393
397
|
}),
|
394
398
|
]);
|
395
399
|
|
396
|
-
const { getByLabelText, getByText, getAllByText } = render(
|
400
|
+
const { getByLabelText, getByText, getAllByText, queryAllByText } = render(
|
397
401
|
<ResourcePickerContainer {...baseProps} onRequestChildren={onRequestChildren} />,
|
398
402
|
);
|
399
403
|
await waitFor(() => {
|
@@ -408,6 +412,11 @@ describe('ResourcePickerContainer', () => {
|
|
408
412
|
expect(getByLabelText('Resource breadcrumb')).toBeInTheDocument();
|
409
413
|
});
|
410
414
|
|
415
|
+
// Loading is done
|
416
|
+
await waitFor(() => {
|
417
|
+
expect(queryAllByText('loading Resource list')).toHaveLength(0);
|
418
|
+
});
|
419
|
+
|
411
420
|
// Drill down again
|
412
421
|
user.click(screen.getByRole('button', { name: 'Drill down to Test Page children' }));
|
413
422
|
|