Skip to content

Commit fe741f9

Browse files
committed
Fix some unit tests
1 parent ff49a2b commit fe741f9

File tree

6 files changed

+26
-35
lines changed

6 files changed

+26
-35
lines changed

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/Configure/Queues/Queues.test.tsx

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -241,10 +241,8 @@ describe('Given a list of queues', () => {
241241
subnets: [],
242242
},
243243
app: {
244-
version: {
245-
full: version,
246-
},
247244
wizard: {
245+
version: version,
248246
config: {
249247
Scheduling: {
250248
SlurmQueues: [
@@ -380,10 +378,8 @@ describe('Given a queue', () => {
380378
subnets: [],
381379
},
382380
app: {
383-
version: {
384-
full: '3.4.0',
385-
},
386381
wizard: {
382+
version: '3.4.0',
387383
config: {
388384
HeadNode: {
389385
Networking: {
@@ -474,10 +470,8 @@ describe('Given a queue', () => {
474470
subnets: [],
475471
},
476472
app: {
477-
version: {
478-
full: '3.4.0',
479-
},
480473
wizard: {
474+
version: '3.6.0',
481475
config: {
482476
Scheduling: {
483477
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)