@corva/create-app 0.102.0-0 → 0.102.0-3
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/lib/helpers/cli-version.js +19 -0
- package/package.json +1 -1
- package/templates/ui/javascript/config/jest/setupTests.js +19 -0
- package/templates/ui/javascript/src/App.completion.js +30 -31
- package/templates/ui/javascript/src/App.css +0 -17
- package/templates/ui/javascript/src/App.drilling.js +31 -36
- package/templates/ui/javascript/src/__tests__/App.test.js +27 -2
- package/templates/ui/typescript/config/jest/setupTests.js +19 -0
- package/templates/ui/typescript/src/App.completion.tsx +30 -34
- package/templates/ui/typescript/src/App.css +0 -17
- package/templates/ui/typescript/src/App.drilling.tsx +30 -34
- package/templates/ui/typescript/src/__tests__/App.test.tsx +27 -2
|
@@ -36,11 +36,23 @@ Please check your internet connection and that the above request is not blocked
|
|
|
36
36
|
}
|
|
37
37
|
};
|
|
38
38
|
|
|
39
|
+
// Utility function to check if a version is a regular semver without prerelease identifiers
|
|
40
|
+
const isRegularVersion = (version) => {
|
|
41
|
+
return semver.prerelease(version) === null;
|
|
42
|
+
};
|
|
43
|
+
|
|
39
44
|
// NOTE: Stop process and show error if version is outdated
|
|
40
45
|
export async function ensureLatestVersion() {
|
|
41
46
|
const currentVersion = await getCurrentVersion();
|
|
42
47
|
const latestVersion = await getLatestVersion();
|
|
43
48
|
|
|
49
|
+
// Skip version check if current version is a prerelease (dev or next)
|
|
50
|
+
if (!isRegularVersion(currentVersion)) {
|
|
51
|
+
logger.write('Skipping version check for prerelease version.\n');
|
|
52
|
+
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
55
|
+
|
|
44
56
|
const isCurrentVersionOutdated = semver.gt(latestVersion, currentVersion);
|
|
45
57
|
|
|
46
58
|
if (isCurrentVersionOutdated) {
|
|
@@ -65,6 +77,13 @@ export async function warnIfOutdated() {
|
|
|
65
77
|
const currentVersion = await getCurrentVersion();
|
|
66
78
|
const latestVersion = await getLatestVersion();
|
|
67
79
|
|
|
80
|
+
// Skip version check if current version is a prerelease (dev or next)
|
|
81
|
+
if (!isRegularVersion(currentVersion)) {
|
|
82
|
+
logger.write(' ⚠️ Skipping version check for prerelease version.\n');
|
|
83
|
+
|
|
84
|
+
return;
|
|
85
|
+
}
|
|
86
|
+
|
|
68
87
|
const isCurrentVersionOutdated = semver.gt(latestVersion, currentVersion);
|
|
69
88
|
|
|
70
89
|
if (isCurrentVersionOutdated) {
|
package/package.json
CHANGED
|
@@ -9,3 +9,22 @@ import '@testing-library/jest-dom/extend-expect';
|
|
|
9
9
|
|
|
10
10
|
// Set UTC timezone for tests to not use the environment timezone
|
|
11
11
|
process.env.TZ = 'UTC';
|
|
12
|
+
|
|
13
|
+
// Mock ResizeObserver & MutationObserver
|
|
14
|
+
class FakeObserver {
|
|
15
|
+
observe() {}
|
|
16
|
+
unobserve() {}
|
|
17
|
+
disconnect() {}
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
global.ResizeObserver = FakeObserver;
|
|
21
|
+
global.MutationObserver = FakeObserver;
|
|
22
|
+
|
|
23
|
+
// Suppressing "Could not parse CSS stylesheet" from JSDOM
|
|
24
|
+
const originalConsoleError = global.console.error;
|
|
25
|
+
global.console.error = (message, ...optionalParams) => {
|
|
26
|
+
if (message.includes('Could not parse CSS stylesheet')) {
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
29
|
+
originalConsoleError(message, ...optionalParams);
|
|
30
|
+
};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { AppHeader } from '@corva/ui/
|
|
1
|
+
import { AppContainer, AppHeader } from '@corva/ui/componentsV2';
|
|
2
|
+
import { useAppCommons } from '@corva/ui/effects';
|
|
2
3
|
|
|
3
4
|
import { DEFAULT_SETTINGS } from './constants';
|
|
4
5
|
import logo from './assets/logo.svg';
|
|
@@ -8,54 +9,52 @@ import styles from './App.css';
|
|
|
8
9
|
/**
|
|
9
10
|
* @param {Object} props
|
|
10
11
|
* @param {boolean} props.isExampleCheckboxChecked
|
|
11
|
-
* @param {Object} props.appHeaderProps
|
|
12
12
|
* @param {Object} props.fracFleet
|
|
13
13
|
* @param {Object} props.well
|
|
14
14
|
* @param {Object[]} props.wells
|
|
15
15
|
* @returns
|
|
16
16
|
*/
|
|
17
17
|
function App({
|
|
18
|
-
appHeaderProps,
|
|
19
18
|
isExampleCheckboxChecked = DEFAULT_SETTINGS.isExampleCheckboxChecked,
|
|
20
19
|
fracFleet,
|
|
21
20
|
well,
|
|
22
21
|
wells,
|
|
23
22
|
}) {
|
|
23
|
+
const { appKey } = useAppCommons();
|
|
24
24
|
// NOTE: On general type dashboard app receives wells array
|
|
25
25
|
// on asset type dashboard app receives well object
|
|
26
26
|
const wellsList = wells || [well];
|
|
27
27
|
|
|
28
28
|
return (
|
|
29
|
-
<
|
|
30
|
-
<
|
|
31
|
-
|
|
32
|
-
<
|
|
33
|
-
<
|
|
34
|
-
<
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
</
|
|
39
|
-
<
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
<
|
|
54
|
-
Settings "Example" checkbox is{' '}
|
|
29
|
+
<AppContainer header={<AppHeader />} testId={appKey}>
|
|
30
|
+
<div>
|
|
31
|
+
<img src={logo} alt="logo" className={styles.logo} />
|
|
32
|
+
<p>
|
|
33
|
+
Edit <code>src/App.js</code> and save to reload.
|
|
34
|
+
<br />
|
|
35
|
+
<br />
|
|
36
|
+
</p>
|
|
37
|
+
<p>
|
|
38
|
+
Frac Fleet: <span data-testid="fracFleet">{fracFleet?.name || 'No Frac Fleet'}</span>
|
|
39
|
+
<br />
|
|
40
|
+
Wells: <span data-testid="wellsList">{wellsList.map(well => well.name).join(', ')}</span>
|
|
41
|
+
</p>
|
|
42
|
+
<a
|
|
43
|
+
className="App-link"
|
|
44
|
+
href="https://reactjs.org"
|
|
45
|
+
target="_blank"
|
|
46
|
+
rel="noopener noreferrer"
|
|
47
|
+
>
|
|
48
|
+
Learn React
|
|
49
|
+
</a>
|
|
50
|
+
</div>
|
|
51
|
+
<div>
|
|
52
|
+
Settings "Example" checkbox is{' '}
|
|
53
|
+
<span data-testid="exampleCheckboxChecked">
|
|
55
54
|
{isExampleCheckboxChecked ? 'checked' : 'unchecked'}
|
|
56
|
-
</
|
|
55
|
+
</span>
|
|
57
56
|
</div>
|
|
58
|
-
</
|
|
57
|
+
</AppContainer>
|
|
59
58
|
);
|
|
60
59
|
}
|
|
61
60
|
|
|
@@ -1,20 +1,3 @@
|
|
|
1
|
-
.container {
|
|
2
|
-
display: flex;
|
|
3
|
-
flex-direction: column;
|
|
4
|
-
height: 100%;
|
|
5
|
-
padding: 12px 12px 30px 12px;
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
.content {
|
|
9
|
-
display: flex;
|
|
10
|
-
flex-direction: column;
|
|
11
|
-
text-align: center;
|
|
12
|
-
align-items: center;
|
|
13
|
-
justify-content: center;
|
|
14
|
-
flex-grow: 1;
|
|
15
|
-
overflow: auto;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
1
|
@keyframes App-logo-spin {
|
|
19
2
|
from {
|
|
20
3
|
transform: rotate(0deg);
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { AppHeader } from '@corva/ui/
|
|
1
|
+
import { AppContainer, AppHeader } from '@corva/ui/componentsV2';
|
|
2
|
+
import { useAppCommons } from '@corva/ui/effects';
|
|
2
3
|
|
|
3
4
|
import { DEFAULT_SETTINGS } from './constants';
|
|
4
5
|
import logo from './assets/logo.svg';
|
|
@@ -7,49 +8,43 @@ import styles from './App.css';
|
|
|
7
8
|
|
|
8
9
|
/**
|
|
9
10
|
* @param {Object} props
|
|
10
|
-
* @param {Object} props.appHeaderProps
|
|
11
11
|
* @param {boolean} props.isExampleCheckboxChecked
|
|
12
12
|
* @param {Object} props.rig
|
|
13
13
|
* @param {Object} props.well
|
|
14
14
|
* @returns
|
|
15
15
|
*/
|
|
16
|
-
function App({
|
|
17
|
-
|
|
18
|
-
isExampleCheckboxChecked = DEFAULT_SETTINGS.isExampleCheckboxChecked,
|
|
19
|
-
rig,
|
|
20
|
-
well,
|
|
21
|
-
}) {
|
|
16
|
+
function App({ isExampleCheckboxChecked = DEFAULT_SETTINGS.isExampleCheckboxChecked, rig, well }) {
|
|
17
|
+
const { appKey } = useAppCommons();
|
|
22
18
|
return (
|
|
23
|
-
<
|
|
24
|
-
<
|
|
25
|
-
|
|
26
|
-
<
|
|
27
|
-
<
|
|
28
|
-
<
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
</
|
|
33
|
-
<
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
<
|
|
48
|
-
Settings "Example" checkbox is{' '}
|
|
19
|
+
<AppContainer header={<AppHeader />} testId={appKey}>
|
|
20
|
+
<div>
|
|
21
|
+
<img src={logo} alt="logo" className={styles.logo} />
|
|
22
|
+
<p>
|
|
23
|
+
Edit <code>src/App.js</code> and save to reload.
|
|
24
|
+
<br />
|
|
25
|
+
<br />
|
|
26
|
+
</p>
|
|
27
|
+
<p>
|
|
28
|
+
Rig: <span data-testid="rig">{rig.name}</span>
|
|
29
|
+
<br />
|
|
30
|
+
Well: <span data-testid="well">{well.name}</span>
|
|
31
|
+
</p>
|
|
32
|
+
<a
|
|
33
|
+
className="App-link"
|
|
34
|
+
href="https://reactjs.org"
|
|
35
|
+
target="_blank"
|
|
36
|
+
rel="noopener noreferrer"
|
|
37
|
+
>
|
|
38
|
+
Learn React
|
|
39
|
+
</a>
|
|
40
|
+
</div>
|
|
41
|
+
<div>
|
|
42
|
+
Settings "Example" checkbox is{' '}
|
|
43
|
+
<span data-testid="exampleCheckboxState">
|
|
49
44
|
{isExampleCheckboxChecked ? 'checked' : 'unchecked'}
|
|
50
|
-
</
|
|
45
|
+
</span>
|
|
51
46
|
</div>
|
|
52
|
-
</
|
|
47
|
+
</AppContainer>
|
|
53
48
|
);
|
|
54
49
|
}
|
|
55
50
|
|
|
@@ -1,11 +1,24 @@
|
|
|
1
1
|
import { render, screen } from '@testing-library/react';
|
|
2
|
+
import { AppTestWrapper } from '@corva/ui/testing';
|
|
2
3
|
|
|
3
4
|
import App from '../App';
|
|
4
5
|
import { mockAppProps } from '../__mocks__/mockAppProps';
|
|
5
6
|
|
|
6
7
|
describe('<App />', () => {
|
|
7
8
|
it('should show correct layout', () => {
|
|
8
|
-
render(
|
|
9
|
+
render(
|
|
10
|
+
<AppTestWrapper
|
|
11
|
+
app={mockAppProps.app}
|
|
12
|
+
appId={123}
|
|
13
|
+
maximized={false}
|
|
14
|
+
appSettings={mockAppProps.app.settings}
|
|
15
|
+
onSettingChange={() => {
|
|
16
|
+
/* noop */
|
|
17
|
+
}}
|
|
18
|
+
>
|
|
19
|
+
<App {...mockAppProps} />
|
|
20
|
+
</AppTestWrapper>
|
|
21
|
+
);
|
|
9
22
|
|
|
10
23
|
screen.getByText(/checked/i);
|
|
11
24
|
});
|
|
@@ -14,7 +27,19 @@ describe('<App />', () => {
|
|
|
14
27
|
const propsWithoutSettings = mockAppProps;
|
|
15
28
|
delete propsWithoutSettings.isExampleCheckboxChecked;
|
|
16
29
|
|
|
17
|
-
render(
|
|
30
|
+
render(
|
|
31
|
+
<AppTestWrapper
|
|
32
|
+
app={mockAppProps.app}
|
|
33
|
+
appId={123}
|
|
34
|
+
maximized={false}
|
|
35
|
+
appSettings={mockAppProps.app.settings}
|
|
36
|
+
onSettingChange={() => {
|
|
37
|
+
/* noop */
|
|
38
|
+
}}
|
|
39
|
+
>
|
|
40
|
+
<App {...propsWithoutSettings} />
|
|
41
|
+
</AppTestWrapper>
|
|
42
|
+
);
|
|
18
43
|
|
|
19
44
|
screen.getByText(/unchecked/i);
|
|
20
45
|
});
|
|
@@ -9,3 +9,22 @@ import '@testing-library/jest-dom/extend-expect';
|
|
|
9
9
|
|
|
10
10
|
// Set UTC timezone for tests to not use the environment timezone
|
|
11
11
|
process.env.TZ = 'UTC';
|
|
12
|
+
|
|
13
|
+
// Mock ResizeObserver & MutationObserver
|
|
14
|
+
class FakeObserver {
|
|
15
|
+
observe() {}
|
|
16
|
+
unobserve() {}
|
|
17
|
+
disconnect() {}
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
global.ResizeObserver = FakeObserver;
|
|
21
|
+
global.MutationObserver = FakeObserver;
|
|
22
|
+
|
|
23
|
+
// Suppressing "Could not parse CSS stylesheet" from JSDOM
|
|
24
|
+
const originalConsoleError = global.console.error;
|
|
25
|
+
global.console.error = (message, ...optionalParams) => {
|
|
26
|
+
if (message.includes('Could not parse CSS stylesheet')) {
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
29
|
+
originalConsoleError(message, ...optionalParams);
|
|
30
|
+
};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { AppHeader } from '@corva/ui/
|
|
1
|
+
import { AppContainer, AppHeader } from '@corva/ui/componentsV2';
|
|
2
|
+
import { useAppCommons } from '@corva/ui/effects';
|
|
2
3
|
|
|
3
4
|
import { DEFAULT_SETTINGS } from './constants';
|
|
4
5
|
import logo from './assets/logo.svg';
|
|
@@ -6,10 +7,6 @@ import logo from './assets/logo.svg';
|
|
|
6
7
|
import styles from './App.css';
|
|
7
8
|
|
|
8
9
|
type AppProps = {
|
|
9
|
-
appHeaderProps: {
|
|
10
|
-
[key: string]: any;
|
|
11
|
-
app: any;
|
|
12
|
-
};
|
|
13
10
|
isExampleCheckboxChecked?: boolean;
|
|
14
11
|
fracFleet?: { name: string };
|
|
15
12
|
well?: { name: string };
|
|
@@ -17,47 +14,46 @@ type AppProps = {
|
|
|
17
14
|
};
|
|
18
15
|
|
|
19
16
|
function App({
|
|
20
|
-
appHeaderProps,
|
|
21
17
|
isExampleCheckboxChecked = DEFAULT_SETTINGS.isExampleCheckboxChecked,
|
|
22
18
|
fracFleet,
|
|
23
19
|
well,
|
|
24
20
|
wells,
|
|
25
21
|
}: AppProps): JSX.Element {
|
|
22
|
+
const { appKey } = useAppCommons();
|
|
26
23
|
// NOTE: On general type dashboard app receives wells array
|
|
27
24
|
// on asset type dashboard app receives well object
|
|
28
25
|
const wellsList = wells || [well];
|
|
29
26
|
|
|
30
27
|
return (
|
|
31
|
-
<
|
|
32
|
-
<
|
|
33
|
-
|
|
34
|
-
<
|
|
35
|
-
<
|
|
36
|
-
<
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
</
|
|
41
|
-
<
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
<
|
|
56
|
-
Settings "Example" checkbox is{' '}
|
|
28
|
+
<AppContainer header={<AppHeader />} testId={appKey}>
|
|
29
|
+
<div>
|
|
30
|
+
<img src={logo} alt="logo" className={styles.logo} />
|
|
31
|
+
<p>
|
|
32
|
+
Edit <code>src/App.js</code> and save to reload.
|
|
33
|
+
<br />
|
|
34
|
+
<br />
|
|
35
|
+
</p>
|
|
36
|
+
<p>
|
|
37
|
+
Frac Fleet: <span data-testid="fracFleet">{fracFleet?.name || 'No Frac Fleet'}</span>
|
|
38
|
+
<br />
|
|
39
|
+
Wells: <span data-testid="wellsList">{wellsList.map(well => well.name).join(', ')}</span>
|
|
40
|
+
</p>
|
|
41
|
+
<a
|
|
42
|
+
className="App-link"
|
|
43
|
+
href="https://reactjs.org"
|
|
44
|
+
target="_blank"
|
|
45
|
+
rel="noopener noreferrer"
|
|
46
|
+
>
|
|
47
|
+
Learn React
|
|
48
|
+
</a>
|
|
49
|
+
</div>
|
|
50
|
+
<div>
|
|
51
|
+
Settings "Example" checkbox is{' '}
|
|
52
|
+
<span data-testid="exampleCheckboxState">
|
|
57
53
|
{isExampleCheckboxChecked ? 'checked' : 'unchecked'}
|
|
58
|
-
</
|
|
54
|
+
</span>
|
|
59
55
|
</div>
|
|
60
|
-
</
|
|
56
|
+
</AppContainer>
|
|
61
57
|
);
|
|
62
58
|
}
|
|
63
59
|
|
|
@@ -1,20 +1,3 @@
|
|
|
1
|
-
.container {
|
|
2
|
-
display: flex;
|
|
3
|
-
flex-direction: column;
|
|
4
|
-
height: 100%;
|
|
5
|
-
padding: 12px 12px 30px 12px;
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
.content {
|
|
9
|
-
display: flex;
|
|
10
|
-
flex-direction: column;
|
|
11
|
-
text-align: center;
|
|
12
|
-
align-items: center;
|
|
13
|
-
justify-content: center;
|
|
14
|
-
flex-grow: 1;
|
|
15
|
-
overflow: auto;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
1
|
@keyframes App-logo-spin {
|
|
19
2
|
from {
|
|
20
3
|
transform: rotate(0deg);
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { AppHeader } from '@corva/ui/
|
|
1
|
+
import { AppContainer, AppHeader } from '@corva/ui/componentsV2';
|
|
2
|
+
import { useAppCommons } from '@corva/ui/effects';
|
|
2
3
|
|
|
3
4
|
import { DEFAULT_SETTINGS } from './constants';
|
|
4
5
|
import logo from './assets/logo.svg';
|
|
@@ -6,52 +7,47 @@ import logo from './assets/logo.svg';
|
|
|
6
7
|
import styles from './App.css';
|
|
7
8
|
|
|
8
9
|
type AppProps = {
|
|
9
|
-
appHeaderProps: {
|
|
10
|
-
[key: string]: any;
|
|
11
|
-
app: any;
|
|
12
|
-
};
|
|
13
10
|
isExampleCheckboxChecked?: boolean;
|
|
14
11
|
rig: { name: string };
|
|
15
12
|
well: { name: string };
|
|
16
13
|
};
|
|
17
14
|
|
|
18
15
|
function App({
|
|
19
|
-
appHeaderProps,
|
|
20
16
|
isExampleCheckboxChecked = DEFAULT_SETTINGS.isExampleCheckboxChecked,
|
|
21
17
|
rig,
|
|
22
18
|
well,
|
|
23
19
|
}: AppProps): JSX.Element {
|
|
20
|
+
const { appKey } = useAppCommons();
|
|
24
21
|
return (
|
|
25
|
-
<
|
|
26
|
-
<
|
|
27
|
-
|
|
28
|
-
<
|
|
29
|
-
<
|
|
30
|
-
<
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
</
|
|
35
|
-
<
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
<
|
|
50
|
-
Settings "Example" checkbox is{' '}
|
|
22
|
+
<AppContainer header={<AppHeader />} testId={appKey}>
|
|
23
|
+
<div>
|
|
24
|
+
<img src={logo} alt="logo" className={styles.logo} />
|
|
25
|
+
<p>
|
|
26
|
+
Edit <code>src/App.js</code> and save to reload.
|
|
27
|
+
<br />
|
|
28
|
+
<br />
|
|
29
|
+
</p>
|
|
30
|
+
<p>
|
|
31
|
+
Rig: <span data-testid="rig">{rig.name}</span>
|
|
32
|
+
<br />
|
|
33
|
+
Well: <span data-testid="well">{well.name}</span>
|
|
34
|
+
</p>
|
|
35
|
+
<a
|
|
36
|
+
className="App-link"
|
|
37
|
+
href="https://reactjs.org"
|
|
38
|
+
target="_blank"
|
|
39
|
+
rel="noopener noreferrer"
|
|
40
|
+
>
|
|
41
|
+
Learn React
|
|
42
|
+
</a>
|
|
43
|
+
</div>
|
|
44
|
+
<div>
|
|
45
|
+
Settings "Example" checkbox is{' '}
|
|
46
|
+
<span data-testid="exampleCheckboxState">
|
|
51
47
|
{isExampleCheckboxChecked ? 'checked' : 'unchecked'}
|
|
52
|
-
</
|
|
48
|
+
</span>
|
|
53
49
|
</div>
|
|
54
|
-
</
|
|
50
|
+
</AppContainer>
|
|
55
51
|
);
|
|
56
52
|
}
|
|
57
53
|
|
|
@@ -1,11 +1,24 @@
|
|
|
1
1
|
import { render, screen } from '@testing-library/react';
|
|
2
|
+
import { AppTestWrapper } from '@corva/ui/testing';
|
|
2
3
|
|
|
3
4
|
import App from '../App';
|
|
4
5
|
import { mockAppProps } from '../__mocks__/mockAppProps';
|
|
5
6
|
|
|
6
7
|
describe('<App />', () => {
|
|
7
8
|
it('should show correct layout', () => {
|
|
8
|
-
render(
|
|
9
|
+
render(
|
|
10
|
+
<AppTestWrapper
|
|
11
|
+
app={mockAppProps.app}
|
|
12
|
+
appId={123}
|
|
13
|
+
maximized={false}
|
|
14
|
+
appSettings={mockAppProps.app.settings}
|
|
15
|
+
onSettingChange={() => {
|
|
16
|
+
/* noop */
|
|
17
|
+
}}
|
|
18
|
+
>
|
|
19
|
+
<App {...mockAppProps} />
|
|
20
|
+
</AppTestWrapper>
|
|
21
|
+
);
|
|
9
22
|
|
|
10
23
|
screen.getByText(/checked/i);
|
|
11
24
|
});
|
|
@@ -14,7 +27,19 @@ describe('<App />', () => {
|
|
|
14
27
|
const propsWithoutSettings = mockAppProps;
|
|
15
28
|
delete propsWithoutSettings.isExampleCheckboxChecked;
|
|
16
29
|
|
|
17
|
-
render(
|
|
30
|
+
render(
|
|
31
|
+
<AppTestWrapper
|
|
32
|
+
app={mockAppProps.app}
|
|
33
|
+
appId={123}
|
|
34
|
+
maximized={false}
|
|
35
|
+
appSettings={mockAppProps.app.settings}
|
|
36
|
+
onSettingChange={() => {
|
|
37
|
+
/* noop */
|
|
38
|
+
}}
|
|
39
|
+
>
|
|
40
|
+
<App {...propsWithoutSettings} />
|
|
41
|
+
</AppTestWrapper>
|
|
42
|
+
);
|
|
18
43
|
|
|
19
44
|
screen.getByText(/unchecked/i);
|
|
20
45
|
});
|