Skip to content

Commit 3f16aa2

Browse files
committed
Fix some unit tests
1 parent ff49a2b commit 3f16aa2

File tree

8 files changed

+43
-54
lines changed

8 files changed

+43
-54
lines changed

frontend/src/components/__tests__/useLoadingState.test.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ describe('given a hook to load all the data necessary for the app to boot', () =
109109
mockStore.getState.mockReturnValue({
110110
identity: null,
111111
app: {
112-
version: {full: '3.5.0'},
112+
wizard: {version: '3.5.0'},
113113
appConfig: {
114114
someKey: 'some-value',
115115
},
@@ -131,7 +131,9 @@ describe('given a hook to load all the data necessary for the app to boot', () =
131131
someKey: 'some-value',
132132
},
133133
app: {
134-
version: {full: '3.5.0'},
134+
wizard: {
135+
version: '3.5.0',
136+
},
135137
appConfig: null,
136138
},
137139
})

frontend/src/old-pages/Clusters/Costs/__tests__/EnableCostMonitoringButton.test.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ describe('given a component to activate cost monitoring for the account', () =>
5959
beforeEach(() => {
6060
mockStore.getState.mockReturnValue({
6161
app: {
62-
version: {full: '3.2.0'},
62+
wizard: {version: '3.2.0'},
6363
},
6464
aws: {
6565
region: 'us-west-1',
@@ -92,7 +92,7 @@ describe('given a component to activate cost monitoring for the account', () =>
9292
beforeEach(() => {
9393
mockStore.getState.mockReturnValue({
9494
app: {
95-
version: {full: '3.2.0'},
95+
wizard: {version: '3.2.0'},
9696
},
9797
aws: {
9898
region: 'us-west-1',
@@ -121,7 +121,7 @@ describe('given a component to activate cost monitoring for the account', () =>
121121
beforeEach(() => {
122122
mockStore.getState.mockReturnValue({
123123
app: {
124-
version: {full: '3.1.5'},
124+
wizard: {version: '3.1.5'},
125125
},
126126
aws: {
127127
region: 'us-west-1',

frontend/src/old-pages/Clusters/__tests__/Tabs.test.tsx

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,11 @@ describe('Given a cluster and a list of tabs', () => {
4040
clusters: {
4141
selected: 'foo',
4242
},
43+
wizard: {
44+
version: '3.5.0',
45+
},
4346
version: {
44-
full: '3.5.0',
47+
full: ['3.5.0', '3.6.0'],
4548
},
4649
},
4750
clusters: {
@@ -72,8 +75,11 @@ describe('Given a cluster and a list of tabs', () => {
7275
clusters: {
7376
selected: 'foo',
7477
},
78+
wizard: {
79+
version: '3.5.0',
80+
},
7581
version: {
76-
full: '3.5.0',
82+
full: ['3.5.0', '3.6.0'],
7783
},
7884
},
7985
clusters: {

frontend/src/old-pages/Configure/Queues/Queues.test.tsx

Lines changed: 8 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -97,10 +97,8 @@ describe('Given a list of queues', () => {
9797
subnets: [],
9898
},
9999
app: {
100-
version: {
101-
full: version,
102-
},
103100
wizard: {
101+
version: version,
104102
config: {
105103
Scheduling: {
106104
SlurmQueues: queues,
@@ -150,10 +148,8 @@ describe('Given a list of queues', () => {
150148
subnets: [],
151149
},
152150
app: {
153-
version: {
154-
full: version,
155-
},
156151
wizard: {
152+
version: version,
157153
config: {
158154
Scheduling: {
159155
SlurmQueues: queues,
@@ -189,10 +185,8 @@ describe('Given a list of queues', () => {
189185
subnets: [],
190186
},
191187
app: {
192-
version: {
193-
full: version,
194-
},
195188
wizard: {
189+
version: version,
196190
config: {
197191
Scheduling: {
198192
SlurmQueues: [
@@ -241,10 +235,8 @@ describe('Given a list of queues', () => {
241235
subnets: [],
242236
},
243237
app: {
244-
version: {
245-
full: version,
246-
},
247238
wizard: {
239+
version: version,
248240
config: {
249241
Scheduling: {
250242
SlurmQueues: [
@@ -305,10 +297,8 @@ describe('Given a list of queues', () => {
305297
subnets: [],
306298
},
307299
app: {
308-
version: {
309-
full: '3.6.0',
310-
},
311300
wizard: {
301+
version: '3.6.0',
312302
config: {
313303
Scheduling: {
314304
SlurmQueues: queues,
@@ -380,10 +370,8 @@ describe('Given a queue', () => {
380370
subnets: [],
381371
},
382372
app: {
383-
version: {
384-
full: '3.4.0',
385-
},
386373
wizard: {
374+
version: '3.4.0',
387375
config: {
388376
HeadNode: {
389377
Networking: {
@@ -474,10 +462,8 @@ describe('Given a queue', () => {
474462
subnets: [],
475463
},
476464
app: {
477-
version: {
478-
full: '3.4.0',
479-
},
480465
wizard: {
466+
version: '3.6.0',
481467
config: {
482468
Scheduling: {
483469
SlurmQueues: [
@@ -529,10 +515,8 @@ describe('Given a queue', () => {
529515
subnets: [],
530516
},
531517
app: {
532-
version: {
533-
full: '3.4.0',
534-
},
535518
wizard: {
519+
version: '3.4.0',
536520
config: {
537521
Scheduling: {
538522
SlurmQueues: [

frontend/src/old-pages/Configure/Version/ClusterVersionField.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ export function ClusterVersionField({ hideLabel = false }: ClusterVersionFieldPr
4343
const editing = !!useState(editingPath)
4444
const versions = useState(['app', 'version', 'full'])
4545

46-
const options = versions.map((version: any) => ({
46+
const options = (versions || []).map((version: string) => ({
4747
label: version,
4848
value: version
4949
}))

frontend/src/old-pages/Configure/__tests__/Configure.test.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ describe('Given a configure component (wizard)', () => {
3030
source: {
3131
loading: true,
3232
},
33+
version: '3.12.0'
3334
},
3435
},
3536
})
@@ -57,6 +58,7 @@ describe('Given a configure component (wizard)', () => {
5758
source: {
5859
loading: false,
5960
},
61+
version: '3.12.0'
6062
},
6163
},
6264
})

frontend/src/old-pages/Configure/__tests__/dynamicFS.test.tsx

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,11 @@ describe('Given a PCluster version', () => {
1212
mockStore.getState.mockReturnValue({
1313
app: {
1414
version: {
15-
full: '3.3.0',
15+
full: ['3.3.0'],
1616
},
1717
wizard: {
1818
editing: true,
19+
version: '3.3.0',
1920
},
2021
},
2122
})
@@ -33,11 +34,9 @@ describe('Given a PCluster version', () => {
3334
it('should let the user add or remove filesystems', () => {
3435
mockStore.getState.mockReturnValue({
3536
app: {
36-
version: {
37-
full: '3.2.0',
38-
},
3937
wizard: {
4038
editing: false,
39+
version: '3.2.0',
4140
},
4241
},
4342
})
@@ -55,11 +54,9 @@ describe('Given a PCluster version', () => {
5554
it('should block the user from creating or removing filesystems', () => {
5655
mockStore.getState.mockReturnValue({
5756
app: {
58-
version: {
59-
full: '3.2.0',
60-
},
6157
wizard: {
6258
editing: true,
59+
version: '3.2.0',
6360
},
6461
},
6562
})

frontend/src/old-pages/Configure/__tests__/storage.test.tsx

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -198,8 +198,8 @@ describe('Given a Lustre storage component', () => {
198198
beforeEach(() => {
199199
mockStore.getState.mockReturnValue({
200200
app: {
201-
version: {
202-
full: '3.3.0',
201+
wizard: {
202+
version: '3.3.0',
203203
},
204204
},
205205
})
@@ -238,8 +238,8 @@ describe('Given a Lustre storage component', () => {
238238
beforeEach(() => {
239239
mockStore.getState.mockReturnValue({
240240
app: {
241-
version: {
242-
full: '3.2.0',
241+
wizard: {
242+
version: '3.2.0',
243243
},
244244
},
245245
})
@@ -284,8 +284,8 @@ describe('given a component to display an Efs storage instance', () => {
284284
beforeEach(() => {
285285
mockStore.getState.mockReturnValue({
286286
app: {
287-
version: {
288-
full: '3.3.0',
287+
wizard: {
288+
version: '3.3.0',
289289
},
290290
},
291291
})
@@ -324,8 +324,8 @@ describe('given a component to display an Efs storage instance', () => {
324324
beforeEach(() => {
325325
mockStore.getState.mockReturnValue({
326326
app: {
327-
version: {
328-
full: '3.2.0',
327+
wizard: {
328+
version: '3.2.0',
329329
},
330330
},
331331
})
@@ -370,8 +370,8 @@ describe('given a component to display an Ebs storage instance', () => {
370370
beforeEach(() => {
371371
mockStore.getState.mockReturnValue({
372372
app: {
373-
version: {
374-
full: '3.2.0',
373+
wizard: {
374+
version: '3.2.0',
375375
},
376376
},
377377
})
@@ -410,8 +410,8 @@ describe('given a component to display an Ebs storage instance', () => {
410410
beforeEach(() => {
411411
mockStore.getState.mockReturnValue({
412412
app: {
413-
version: {
414-
full: '3.1.0',
413+
wizard: {
414+
version: '3.1.0',
415415
},
416416
},
417417
})
@@ -448,10 +448,8 @@ describe('given a component to display an Ebs storage instance', () => {
448448
beforeEach(() => {
449449
mockStore.getState.mockReturnValue({
450450
app: {
451-
version: {
452-
full: '3.2.0',
453-
},
454451
wizard: {
452+
version: '3.2.0',
455453
config: {
456454
SharedStorage: [
457455
{

0 commit comments

Comments
 (0)