orc-shared 5.10.0-dev.18 → 5.10.0-dev.19
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/dist/components/AppFrame/About.js +134 -100
- package/dist/components/AppFrame/Anchor.js +45 -21
- package/dist/components/AppFrame/AppFrame.js +53 -31
- package/dist/components/AppFrame/Help.js +35 -15
- package/dist/components/AppFrame/MenuItem.js +148 -114
- package/dist/components/AppFrame/Preferences.js +95 -57
- package/dist/components/AppFrame/Sidebar.js +51 -28
- package/dist/components/AppFrame/Topbar.js +61 -36
- package/package.json +1 -1
- package/src/components/AppFrame/About.js +91 -113
- package/src/components/AppFrame/About.test.js +127 -89
- package/src/components/AppFrame/Anchor.js +34 -36
- package/src/components/AppFrame/Anchor.test.js +5 -68
- package/src/components/AppFrame/AppFrame.js +31 -40
- package/src/components/AppFrame/AppFrame.test.js +424 -432
- package/src/components/AppFrame/Help.js +23 -20
- package/src/components/AppFrame/Help.test.js +3 -3
- package/src/components/AppFrame/MenuItem.js +106 -126
- package/src/components/AppFrame/MenuItem.test.js +78 -169
- package/src/components/AppFrame/Preferences.js +83 -72
- package/src/components/AppFrame/Preferences.test.js +24 -30
- package/src/components/AppFrame/Sidebar.js +39 -41
- package/src/components/AppFrame/Sidebar.test.js +88 -168
- package/src/components/AppFrame/Topbar.js +59 -52
- package/src/components/AppFrame/Topbar.test.js +28 -29
- package/dist/components/AppFrame/ApplicationSelector/Header.js +0 -82
- package/src/components/AppFrame/ApplicationSelector/Header.js +0 -34
- package/src/components/AppFrame/ApplicationSelector/Header.test.js +0 -23
|
@@ -1,28 +1,21 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import Immutable from "immutable";
|
|
3
|
-
import { ThemeProvider } from "styled-components";
|
|
4
3
|
import { RSAA } from "redux-api-middleware";
|
|
5
|
-
import { Provider } from "react-redux";
|
|
6
|
-
import { MemoryRouter } from "react-router-dom";
|
|
7
4
|
import sinon from "sinon";
|
|
8
5
|
import { Ignore } from "unexpected-reaction";
|
|
9
6
|
import { mount, simulate } from "unexpected-reaction";
|
|
10
7
|
import { mount as enzymeMount } from "enzyme";
|
|
11
|
-
import {
|
|
12
|
-
import I18n from "../I18n";
|
|
8
|
+
import { TestWrapper, extractMessages } from "../../utils/testUtils";
|
|
13
9
|
import {
|
|
14
10
|
GET_APPLICATIONS_REQUEST,
|
|
15
11
|
GET_APPLICATIONS_SUCCESS,
|
|
16
12
|
GET_APPLICATIONS_FAILURE,
|
|
17
13
|
} from "../../actions/applications";
|
|
18
14
|
import { ScopeBar, Bar as BarWrapper } from "../Scope";
|
|
19
|
-
import AppFrame
|
|
15
|
+
import AppFrame from "./AppFrame";
|
|
20
16
|
import ApplicationSelector from "./ApplicationSelector";
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import { BlockWithA } from "./MenuItem";
|
|
24
|
-
import { HelpLink } from "./Help";
|
|
25
|
-
import { About } from "./About";
|
|
17
|
+
import { MenuToggle, Logo } from "./Sidebar";
|
|
18
|
+
import { ABOUT_NAME } from "./About";
|
|
26
19
|
import {
|
|
27
20
|
GET_VERSION_INFO_FAILURE,
|
|
28
21
|
GET_VERSION_INFO_REQUEST,
|
|
@@ -32,6 +25,9 @@ import LoadingScreen from "../MaterialUI/Feedback/loadingScreen";
|
|
|
32
25
|
import ActionModal from "../MaterialUI/DataDisplay/PredefinedElements/ActionModal";
|
|
33
26
|
import sharedMessages from "../../sharedMessages";
|
|
34
27
|
import Button from "@material-ui/core/Button";
|
|
28
|
+
import Preferences from "./Preferences";
|
|
29
|
+
|
|
30
|
+
const messages = extractMessages(sharedMessages);
|
|
35
31
|
|
|
36
32
|
jest.mock("../../utils/buildUrl", () => {
|
|
37
33
|
const modExport = {};
|
|
@@ -212,7 +208,7 @@ describe("AppFrame", () => {
|
|
|
212
208
|
},
|
|
213
209
|
settings: { defaultScope: "myScope", defaultApp: "12" },
|
|
214
210
|
versionInfo: { version: "4.2", defaultHelpUrl: "help_url", moduleHelpUrls: [] },
|
|
215
|
-
view: { scopeSelector: { filter: "1" }, __prefsDialog: { show: false } },
|
|
211
|
+
view: { scopeSelector: { filter: "1" }, __prefsDialog: { show: false }, [ABOUT_NAME]: { show: true } },
|
|
216
212
|
toasts: { queue: [] },
|
|
217
213
|
requests: {
|
|
218
214
|
actives: Immutable.Map(),
|
|
@@ -241,51 +237,52 @@ describe("AppFrame", () => {
|
|
|
241
237
|
];
|
|
242
238
|
props.children = [<TestComp1 key="1" />, <TestComp2 key="2" />, <TestComp3 key="3" />];
|
|
243
239
|
expect(
|
|
244
|
-
<
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
</
|
|
240
|
+
<TestWrapper
|
|
241
|
+
provider={{ store }}
|
|
242
|
+
stylesProvider
|
|
243
|
+
muiThemeProvider
|
|
244
|
+
intlProvider={{ messages }}
|
|
245
|
+
memoryRouter={{ initialEntries: ["/Foo/bar"] }}
|
|
246
|
+
>
|
|
247
|
+
<AppFrame {...props} />
|
|
248
|
+
</TestWrapper>,
|
|
253
249
|
"when mounted",
|
|
254
250
|
"to satisfy",
|
|
255
|
-
<
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
<
|
|
268
|
-
|
|
269
|
-
</
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
</
|
|
287
|
-
|
|
288
|
-
|
|
251
|
+
<TestWrapper
|
|
252
|
+
provider={{ store }}
|
|
253
|
+
stylesProvider
|
|
254
|
+
muiThemeProvider
|
|
255
|
+
intlProvider={{ messages }}
|
|
256
|
+
memoryRouter={{ initialEntries: ["/Foo/bar"] }}
|
|
257
|
+
>
|
|
258
|
+
<div>
|
|
259
|
+
<div>
|
|
260
|
+
<div>
|
|
261
|
+
<ApplicationSelector {...props} />
|
|
262
|
+
<div>
|
|
263
|
+
<img />
|
|
264
|
+
Marketing Legacy
|
|
265
|
+
</div>
|
|
266
|
+
</div>
|
|
267
|
+
<Ignore />
|
|
268
|
+
<a>Help</a>
|
|
269
|
+
</div>
|
|
270
|
+
<div>
|
|
271
|
+
<MenuToggle />
|
|
272
|
+
<Ignore />
|
|
273
|
+
<Ignore />
|
|
274
|
+
<Ignore />
|
|
275
|
+
<Logo />
|
|
276
|
+
</div>
|
|
277
|
+
<div>
|
|
278
|
+
<ScopeBar name="Test 1" />
|
|
279
|
+
<TestComp1 key="1" />
|
|
280
|
+
<TestComp2 key="2" />
|
|
281
|
+
<TestComp3 key="3" />
|
|
282
|
+
</div>
|
|
283
|
+
<LoadingScreen />
|
|
284
|
+
</div>
|
|
285
|
+
</TestWrapper>,
|
|
289
286
|
);
|
|
290
287
|
|
|
291
288
|
expect(document.title, "to equal", "Marketing Legacy");
|
|
@@ -295,48 +292,49 @@ describe("AppFrame", () => {
|
|
|
295
292
|
props.modules = undefined;
|
|
296
293
|
props.children = [<TestComp1 key="1" />, <TestComp2 key="2" />, <TestComp3 key="3" />];
|
|
297
294
|
expect(
|
|
298
|
-
<
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
</
|
|
295
|
+
<TestWrapper
|
|
296
|
+
provider={{ store }}
|
|
297
|
+
stylesProvider
|
|
298
|
+
muiThemeProvider
|
|
299
|
+
intlProvider={{ messages }}
|
|
300
|
+
memoryRouter={{ initialEntries: ["/Foo/bar"] }}
|
|
301
|
+
>
|
|
302
|
+
<AppFrame {...props} />
|
|
303
|
+
</TestWrapper>,
|
|
307
304
|
"when mounted",
|
|
308
305
|
"to satisfy",
|
|
309
|
-
<
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
<
|
|
322
|
-
|
|
323
|
-
</
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
</
|
|
338
|
-
|
|
339
|
-
|
|
306
|
+
<TestWrapper
|
|
307
|
+
provider={{ store }}
|
|
308
|
+
stylesProvider
|
|
309
|
+
muiThemeProvider
|
|
310
|
+
intlProvider={{ messages }}
|
|
311
|
+
memoryRouter={{ initialEntries: ["/Foo/bar"] }}
|
|
312
|
+
>
|
|
313
|
+
<div>
|
|
314
|
+
<div>
|
|
315
|
+
<div>
|
|
316
|
+
<ApplicationSelector {...props} />
|
|
317
|
+
<div>
|
|
318
|
+
<img />
|
|
319
|
+
Marketing Legacy
|
|
320
|
+
</div>
|
|
321
|
+
</div>
|
|
322
|
+
<Ignore />
|
|
323
|
+
<a>Help</a>
|
|
324
|
+
</div>
|
|
325
|
+
<div>
|
|
326
|
+
<MenuToggle />
|
|
327
|
+
<Logo />
|
|
328
|
+
</div>
|
|
329
|
+
<div>
|
|
330
|
+
<ScopeBar name="Test 1" />
|
|
331
|
+
<TestComp1 key="1" />
|
|
332
|
+
<TestComp2 key="2" />
|
|
333
|
+
<TestComp3 key="3" />
|
|
334
|
+
</div>
|
|
335
|
+
<LoadingScreen />
|
|
336
|
+
</div>
|
|
337
|
+
</TestWrapper>,
|
|
340
338
|
);
|
|
341
339
|
|
|
342
340
|
expect(document.title, "to equal", "Marketing Legacy");
|
|
@@ -350,50 +348,51 @@ describe("AppFrame", () => {
|
|
|
350
348
|
];
|
|
351
349
|
props.children = [<TestComp1 key="1" />, <TestComp2 key="2" />, <TestComp3 key="3" />];
|
|
352
350
|
expect(
|
|
353
|
-
<
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
</
|
|
351
|
+
<TestWrapper
|
|
352
|
+
provider={{ store }}
|
|
353
|
+
stylesProvider
|
|
354
|
+
muiThemeProvider
|
|
355
|
+
intlProvider={{ messages }}
|
|
356
|
+
memoryRouter={{ initialEntries: ["/Foo/bar"] }}
|
|
357
|
+
>
|
|
358
|
+
<AppFrame {...props} applicationId="other" />
|
|
359
|
+
</TestWrapper>,
|
|
362
360
|
"when mounted",
|
|
363
361
|
"to satisfy",
|
|
364
|
-
<
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
<
|
|
377
|
-
</
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
</
|
|
395
|
-
|
|
396
|
-
|
|
362
|
+
<TestWrapper
|
|
363
|
+
provider={{ store }}
|
|
364
|
+
stylesProvider
|
|
365
|
+
muiThemeProvider
|
|
366
|
+
intlProvider={{ messages }}
|
|
367
|
+
memoryRouter={{ initialEntries: ["/Foo/bar"] }}
|
|
368
|
+
>
|
|
369
|
+
<div>
|
|
370
|
+
<div>
|
|
371
|
+
<div>
|
|
372
|
+
<ApplicationSelector {...props} />
|
|
373
|
+
<div>
|
|
374
|
+
<img />
|
|
375
|
+
</div>
|
|
376
|
+
</div>
|
|
377
|
+
<Ignore />
|
|
378
|
+
<a>Help</a>
|
|
379
|
+
</div>
|
|
380
|
+
<div>
|
|
381
|
+
<MenuToggle />
|
|
382
|
+
<Ignore />
|
|
383
|
+
<Ignore />
|
|
384
|
+
<Ignore />
|
|
385
|
+
<Logo />
|
|
386
|
+
</div>
|
|
387
|
+
<div>
|
|
388
|
+
<ScopeBar name="Test 1" />
|
|
389
|
+
<TestComp1 key="1" />
|
|
390
|
+
<TestComp2 key="2" />
|
|
391
|
+
<TestComp3 key="3" />
|
|
392
|
+
</div>
|
|
393
|
+
<LoadingScreen />
|
|
394
|
+
</div>
|
|
395
|
+
</TestWrapper>,
|
|
397
396
|
);
|
|
398
397
|
|
|
399
398
|
expect(document.title, "to equal", "other");
|
|
@@ -408,50 +407,51 @@ describe("AppFrame", () => {
|
|
|
408
407
|
props.children = [<TestComp1 key="1" />, <TestComp2 key="2" />, <TestComp3 key="3" />];
|
|
409
408
|
state = state.setIn(["applications", "list"], Immutable.fromJS([]));
|
|
410
409
|
expect(
|
|
411
|
-
<
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
</
|
|
410
|
+
<TestWrapper
|
|
411
|
+
provider={{ store }}
|
|
412
|
+
stylesProvider
|
|
413
|
+
muiThemeProvider
|
|
414
|
+
intlProvider={{ messages }}
|
|
415
|
+
memoryRouter={{ initialEntries: ["/Foo/bar"] }}
|
|
416
|
+
>
|
|
417
|
+
<AppFrame {...props} applicationId="other" />
|
|
418
|
+
</TestWrapper>,
|
|
420
419
|
"when mounted",
|
|
421
420
|
"to satisfy",
|
|
422
|
-
<
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
<
|
|
435
|
-
</
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
</
|
|
453
|
-
|
|
454
|
-
|
|
421
|
+
<TestWrapper
|
|
422
|
+
provider={{ store }}
|
|
423
|
+
stylesProvider
|
|
424
|
+
muiThemeProvider
|
|
425
|
+
intlProvider={{ messages }}
|
|
426
|
+
memoryRouter={{ initialEntries: ["/Foo/bar"] }}
|
|
427
|
+
>
|
|
428
|
+
<div>
|
|
429
|
+
<div>
|
|
430
|
+
<div>
|
|
431
|
+
<ApplicationSelector {...props} />
|
|
432
|
+
<div>
|
|
433
|
+
<img />
|
|
434
|
+
</div>
|
|
435
|
+
</div>
|
|
436
|
+
<Ignore />
|
|
437
|
+
<a>Help</a>
|
|
438
|
+
</div>
|
|
439
|
+
<div>
|
|
440
|
+
<MenuToggle />
|
|
441
|
+
<Ignore />
|
|
442
|
+
<Ignore />
|
|
443
|
+
<Ignore />
|
|
444
|
+
<Logo />
|
|
445
|
+
</div>
|
|
446
|
+
<div>
|
|
447
|
+
<ScopeBar name="Test 1" />
|
|
448
|
+
<TestComp1 key="1" />
|
|
449
|
+
<TestComp2 key="2" />
|
|
450
|
+
<TestComp3 key="3" />
|
|
451
|
+
</div>
|
|
452
|
+
<LoadingScreen />
|
|
453
|
+
</div>
|
|
454
|
+
</TestWrapper>,
|
|
455
455
|
);
|
|
456
456
|
|
|
457
457
|
expect(document.title, "to equal", "other");
|
|
@@ -465,50 +465,52 @@ describe("AppFrame", () => {
|
|
|
465
465
|
];
|
|
466
466
|
props.children = [<TestComp1 key="1" />, <TestComp2 key="2" />, <TestComp3 key="3" />];
|
|
467
467
|
return expect(
|
|
468
|
-
<
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
</
|
|
468
|
+
<TestWrapper
|
|
469
|
+
provider={{ store }}
|
|
470
|
+
stylesProvider
|
|
471
|
+
muiThemeProvider
|
|
472
|
+
intlProvider={{ messages }}
|
|
473
|
+
memoryRouter={{ initialEntries: ["/Foo/bar"] }}
|
|
474
|
+
>
|
|
475
|
+
<AppFrame noScope {...props} />
|
|
476
|
+
</TestWrapper>,
|
|
477
477
|
"when mounted",
|
|
478
478
|
"to satisfy",
|
|
479
|
-
<
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
<
|
|
492
|
-
|
|
493
|
-
</
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
479
|
+
<TestWrapper
|
|
480
|
+
provider={{ store }}
|
|
481
|
+
stylesProvider
|
|
482
|
+
muiThemeProvider
|
|
483
|
+
intlProvider={{ messages }}
|
|
484
|
+
memoryRouter={{ initialEntries: ["/Foo/bar"] }}
|
|
485
|
+
>
|
|
486
|
+
<div>
|
|
487
|
+
<div>
|
|
488
|
+
<div>
|
|
489
|
+
<ApplicationSelector {...props} />
|
|
490
|
+
<div>
|
|
491
|
+
<img />
|
|
492
|
+
Marketing Legacy
|
|
493
|
+
</div>
|
|
494
|
+
</div>
|
|
495
|
+
<Ignore />
|
|
496
|
+
<a>Help</a>
|
|
497
|
+
</div>
|
|
498
|
+
<div>
|
|
499
|
+
<MenuToggle />
|
|
500
|
+
<Ignore />
|
|
501
|
+
<Ignore />
|
|
502
|
+
<Ignore />
|
|
503
|
+
<Logo />
|
|
504
|
+
</div>
|
|
505
|
+
<div>
|
|
506
|
+
<BarWrapper />
|
|
507
|
+
<TestComp1 />
|
|
508
|
+
<TestComp2 />
|
|
509
|
+
<TestComp3 />
|
|
510
|
+
</div>
|
|
511
|
+
<LoadingScreen />
|
|
512
|
+
</div>
|
|
513
|
+
</TestWrapper>,
|
|
512
514
|
);
|
|
513
515
|
});
|
|
514
516
|
|
|
@@ -521,166 +523,184 @@ describe("AppFrame", () => {
|
|
|
521
523
|
];
|
|
522
524
|
props.children = [<TestComp1 key="1" />, <TestComp2 key="2" />, <TestComp3 key="3" />];
|
|
523
525
|
return expect(
|
|
524
|
-
<
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
</
|
|
526
|
+
<TestWrapper
|
|
527
|
+
provider={{ store }}
|
|
528
|
+
stylesProvider
|
|
529
|
+
muiThemeProvider
|
|
530
|
+
intlProvider={{ messages }}
|
|
531
|
+
memoryRouter={{ initialEntries: ["/Foo/bar"] }}
|
|
532
|
+
>
|
|
533
|
+
<AppFrame {...props} />
|
|
534
|
+
</TestWrapper>,
|
|
533
535
|
"when mounted",
|
|
534
536
|
"to satisfy",
|
|
535
|
-
<
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
537
|
+
<TestWrapper
|
|
538
|
+
provider={{ store }}
|
|
539
|
+
stylesProvider
|
|
540
|
+
muiThemeProvider
|
|
541
|
+
intlProvider={{ messages }}
|
|
542
|
+
memoryRouter={{ initialEntries: ["/Foo/bar"] }}
|
|
543
|
+
>
|
|
544
|
+
<div>
|
|
545
|
+
<Ignore />
|
|
546
|
+
<Ignore />
|
|
547
|
+
<Ignore />
|
|
548
|
+
<Ignore />
|
|
549
|
+
</div>
|
|
550
|
+
</TestWrapper>,
|
|
547
551
|
);
|
|
548
552
|
});
|
|
549
553
|
|
|
550
554
|
it("provides open flag, toggle and reset functions", () => {
|
|
551
555
|
const element = mount(
|
|
552
|
-
<
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
</
|
|
556
|
+
<TestWrapper
|
|
557
|
+
provider={{ store }}
|
|
558
|
+
stylesProvider
|
|
559
|
+
muiThemeProvider
|
|
560
|
+
intlProvider={{ messages }}
|
|
561
|
+
memoryRouter={{ initialEntries: ["/Foo/bar"] }}
|
|
562
|
+
>
|
|
563
|
+
<AppFrame {...props} />
|
|
564
|
+
</TestWrapper>,
|
|
561
565
|
);
|
|
562
566
|
simulate(element, {
|
|
563
567
|
type: "click",
|
|
564
|
-
target:
|
|
568
|
+
target: "#sidebarMenuToggle",
|
|
565
569
|
});
|
|
566
570
|
expect(
|
|
567
571
|
element,
|
|
568
572
|
"to satisfy",
|
|
569
|
-
<
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
<
|
|
585
|
-
</
|
|
586
|
-
|
|
587
|
-
|
|
573
|
+
<TestWrapper
|
|
574
|
+
provider={{ store }}
|
|
575
|
+
stylesProvider
|
|
576
|
+
muiThemeProvider
|
|
577
|
+
intlProvider={{ messages }}
|
|
578
|
+
memoryRouter={{ initialEntries: ["/Foo/bar"] }}
|
|
579
|
+
>
|
|
580
|
+
<div>
|
|
581
|
+
<div>
|
|
582
|
+
<Ignore />
|
|
583
|
+
<Ignore />
|
|
584
|
+
<Ignore />
|
|
585
|
+
</div>
|
|
586
|
+
<div>
|
|
587
|
+
<MenuToggle open />
|
|
588
|
+
<Logo />
|
|
589
|
+
</div>
|
|
590
|
+
<div>
|
|
591
|
+
<Ignore />
|
|
592
|
+
</div>
|
|
593
|
+
<LoadingScreen />
|
|
594
|
+
</div>
|
|
595
|
+
</TestWrapper>,
|
|
588
596
|
);
|
|
589
597
|
simulate(element, {
|
|
590
598
|
type: "click",
|
|
591
|
-
target:
|
|
599
|
+
target: '[data-test-id="wrapper"]',
|
|
592
600
|
});
|
|
593
601
|
expect(
|
|
594
602
|
element,
|
|
595
603
|
"to satisfy",
|
|
596
|
-
<
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
<
|
|
612
|
-
</
|
|
613
|
-
|
|
614
|
-
|
|
604
|
+
<TestWrapper
|
|
605
|
+
provider={{ store }}
|
|
606
|
+
stylesProvider
|
|
607
|
+
muiThemeProvider
|
|
608
|
+
intlProvider={{ messages }}
|
|
609
|
+
memoryRouter={{ initialEntries: ["/Foo/bar"] }}
|
|
610
|
+
>
|
|
611
|
+
<div>
|
|
612
|
+
<div>
|
|
613
|
+
<Ignore />
|
|
614
|
+
<Ignore />
|
|
615
|
+
<Ignore />
|
|
616
|
+
</div>
|
|
617
|
+
<div>
|
|
618
|
+
<MenuToggle />
|
|
619
|
+
<Logo />
|
|
620
|
+
</div>
|
|
621
|
+
<div>
|
|
622
|
+
<Ignore />
|
|
623
|
+
</div>
|
|
624
|
+
<LoadingScreen />
|
|
625
|
+
</div>
|
|
626
|
+
</TestWrapper>,
|
|
615
627
|
);
|
|
616
628
|
simulate(element, {
|
|
617
629
|
type: "click",
|
|
618
|
-
target:
|
|
630
|
+
target: "#sidebarMenuToggle",
|
|
619
631
|
});
|
|
620
632
|
expect(
|
|
621
633
|
element,
|
|
622
634
|
"to satisfy",
|
|
623
|
-
<
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
<
|
|
639
|
-
</
|
|
640
|
-
|
|
641
|
-
|
|
635
|
+
<TestWrapper
|
|
636
|
+
provider={{ store }}
|
|
637
|
+
stylesProvider
|
|
638
|
+
muiThemeProvider
|
|
639
|
+
intlProvider={{ messages }}
|
|
640
|
+
memoryRouter={{ initialEntries: ["/Foo/bar"] }}
|
|
641
|
+
>
|
|
642
|
+
<div>
|
|
643
|
+
<div>
|
|
644
|
+
<Ignore />
|
|
645
|
+
<Ignore />
|
|
646
|
+
<Ignore />
|
|
647
|
+
</div>
|
|
648
|
+
<div>
|
|
649
|
+
<MenuToggle open />
|
|
650
|
+
<Logo />
|
|
651
|
+
</div>
|
|
652
|
+
<div>
|
|
653
|
+
<Ignore />
|
|
654
|
+
</div>
|
|
655
|
+
<LoadingScreen />
|
|
656
|
+
</div>
|
|
657
|
+
</TestWrapper>,
|
|
642
658
|
);
|
|
643
659
|
simulate(element, {
|
|
644
660
|
type: "click",
|
|
645
|
-
target:
|
|
661
|
+
target: '[data-test-id="viewport"]',
|
|
646
662
|
});
|
|
647
663
|
expect(
|
|
648
664
|
element,
|
|
649
665
|
"to satisfy",
|
|
650
|
-
<
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
<
|
|
666
|
-
</
|
|
667
|
-
|
|
668
|
-
|
|
666
|
+
<TestWrapper
|
|
667
|
+
provider={{ store }}
|
|
668
|
+
stylesProvider
|
|
669
|
+
muiThemeProvider
|
|
670
|
+
intlProvider={{ messages }}
|
|
671
|
+
memoryRouter={{ initialEntries: ["/Foo/bar"] }}
|
|
672
|
+
>
|
|
673
|
+
<div>
|
|
674
|
+
<div>
|
|
675
|
+
<Ignore />
|
|
676
|
+
<Ignore />
|
|
677
|
+
<Ignore />
|
|
678
|
+
</div>
|
|
679
|
+
<div>
|
|
680
|
+
<MenuToggle />
|
|
681
|
+
<Logo />
|
|
682
|
+
</div>
|
|
683
|
+
<div>
|
|
684
|
+
<Ignore />
|
|
685
|
+
</div>
|
|
686
|
+
<LoadingScreen />
|
|
687
|
+
</div>
|
|
688
|
+
</TestWrapper>,
|
|
669
689
|
);
|
|
670
690
|
});
|
|
671
691
|
|
|
672
692
|
it("loads applications if not found", () => {
|
|
673
693
|
state = state.setIn(["applications", "list"], Immutable.List());
|
|
674
694
|
return expect(
|
|
675
|
-
<
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
</
|
|
695
|
+
<TestWrapper
|
|
696
|
+
provider={{ store }}
|
|
697
|
+
stylesProvider
|
|
698
|
+
muiThemeProvider
|
|
699
|
+
intlProvider={{ messages }}
|
|
700
|
+
memoryRouter={{ initialEntries: ["/Foo/bar"] }}
|
|
701
|
+
>
|
|
702
|
+
<AppFrame {...props} />
|
|
703
|
+
</TestWrapper>,
|
|
684
704
|
"when mounted",
|
|
685
705
|
"to be truthy",
|
|
686
706
|
).then(() =>
|
|
@@ -703,15 +723,15 @@ describe("AppFrame", () => {
|
|
|
703
723
|
it("loads version info if no help url yet", () => {
|
|
704
724
|
state = state.setIn(["versionInfo", "defaultHelpUrl"], null);
|
|
705
725
|
return expect(
|
|
706
|
-
<
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
</
|
|
726
|
+
<TestWrapper
|
|
727
|
+
provider={{ store }}
|
|
728
|
+
stylesProvider
|
|
729
|
+
muiThemeProvider
|
|
730
|
+
intlProvider={{ messages }}
|
|
731
|
+
memoryRouter={{ initialEntries: ["/Foo/bar"] }}
|
|
732
|
+
>
|
|
733
|
+
<AppFrame {...props} />
|
|
734
|
+
</TestWrapper>,
|
|
715
735
|
"when mounted",
|
|
716
736
|
"to be truthy",
|
|
717
737
|
).then(() =>
|
|
@@ -749,54 +769,54 @@ describe("AppFrame", () => {
|
|
|
749
769
|
const actions = [{ label: sharedMessages.refresh, handler: refreshCallback, isPrimary: true }];
|
|
750
770
|
|
|
751
771
|
expect(
|
|
752
|
-
<
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
</
|
|
772
|
+
<TestWrapper
|
|
773
|
+
provider={{ store }}
|
|
774
|
+
stylesProvider
|
|
775
|
+
muiThemeProvider
|
|
776
|
+
intlProvider={{ messages }}
|
|
777
|
+
memoryRouter={{ initialEntries: ["/Foo/bar"] }}
|
|
778
|
+
>
|
|
779
|
+
<AppFrame {...props} />
|
|
780
|
+
</TestWrapper>,
|
|
761
781
|
"when mounted",
|
|
762
782
|
"to satisfy",
|
|
763
|
-
<
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
</
|
|
799
|
-
</
|
|
783
|
+
<TestWrapper
|
|
784
|
+
provider={{ store }}
|
|
785
|
+
stylesProvider
|
|
786
|
+
muiThemeProvider
|
|
787
|
+
intlProvider={{ messages }}
|
|
788
|
+
memoryRouter={{ initialEntries: ["/Foo/bar"] }}
|
|
789
|
+
>
|
|
790
|
+
<div>
|
|
791
|
+
<ActionModal open={true} title={title} message={message} actions={actions} />
|
|
792
|
+
<div>
|
|
793
|
+
<div>
|
|
794
|
+
<ApplicationSelector {...props} />
|
|
795
|
+
<div>
|
|
796
|
+
<img />
|
|
797
|
+
Marketing Legacy
|
|
798
|
+
</div>
|
|
799
|
+
</div>
|
|
800
|
+
<Ignore />
|
|
801
|
+
<a>Help</a>
|
|
802
|
+
</div>
|
|
803
|
+
<div>
|
|
804
|
+
<MenuToggle />
|
|
805
|
+
<Ignore />
|
|
806
|
+
<Ignore />
|
|
807
|
+
<Ignore />
|
|
808
|
+
<Logo />
|
|
809
|
+
</div>
|
|
810
|
+
<div>
|
|
811
|
+
<ScopeBar name="Test 1" />
|
|
812
|
+
<TestComp1 key="1" />
|
|
813
|
+
<TestComp2 key="2" />
|
|
814
|
+
<TestComp3 key="3" />
|
|
815
|
+
</div>
|
|
816
|
+
<LoadingScreen />
|
|
817
|
+
<Preferences />
|
|
818
|
+
</div>
|
|
819
|
+
</TestWrapper>,
|
|
800
820
|
);
|
|
801
821
|
});
|
|
802
822
|
|
|
@@ -811,15 +831,15 @@ describe("AppFrame", () => {
|
|
|
811
831
|
props.children = [<TestComp1 key="1" />, <TestComp2 key="2" />, <TestComp3 key="3" />];
|
|
812
832
|
|
|
813
833
|
const component = (
|
|
814
|
-
<
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
</
|
|
834
|
+
<TestWrapper
|
|
835
|
+
provider={{ store }}
|
|
836
|
+
stylesProvider
|
|
837
|
+
muiThemeProvider
|
|
838
|
+
intlProvider={{ messages }}
|
|
839
|
+
memoryRouter={{ initialEntries: ["/Foo/bar"] }}
|
|
840
|
+
>
|
|
841
|
+
<AppFrame {...props} />
|
|
842
|
+
</TestWrapper>
|
|
823
843
|
);
|
|
824
844
|
|
|
825
845
|
const mountedComponent = enzymeMount(component);
|
|
@@ -833,31 +853,3 @@ describe("AppFrame", () => {
|
|
|
833
853
|
expect(locationReloadSpy, "was called");
|
|
834
854
|
});
|
|
835
855
|
});
|
|
836
|
-
|
|
837
|
-
describe("ViewPort", () => {
|
|
838
|
-
it("does not translate when closed", () =>
|
|
839
|
-
expect(<ViewPort />, "when mounted", "to have style rules satisfying", "to contain", "width: calc(100% - 50px)"));
|
|
840
|
-
|
|
841
|
-
it("translates to the side when open", () =>
|
|
842
|
-
expect(
|
|
843
|
-
<ViewPort open />,
|
|
844
|
-
"when mounted",
|
|
845
|
-
"to have style rules satisfying",
|
|
846
|
-
"to contain",
|
|
847
|
-
"width: calc(100% - 200px);",
|
|
848
|
-
));
|
|
849
|
-
});
|
|
850
|
-
|
|
851
|
-
describe("Base", () => {
|
|
852
|
-
it("pointer-events should be to default when preferences is hidden", () =>
|
|
853
|
-
expect(<Base />, "when mounted", "to have style rules satisfying", "not to contain", "pointer-events: none;"));
|
|
854
|
-
|
|
855
|
-
it("pointer-events should be none when preferences is shown", () =>
|
|
856
|
-
expect(
|
|
857
|
-
<Base preferencesOpen={true} />,
|
|
858
|
-
"when mounted",
|
|
859
|
-
"to have style rules satisfying",
|
|
860
|
-
"to contain",
|
|
861
|
-
"pointer-events: none;",
|
|
862
|
-
));
|
|
863
|
-
});
|