Skip to content

Commit f64b429

Browse files
netpyne-123 added test to package.json + final step on the tests
1 parent 0b45439 commit f64b429

2 files changed

Lines changed: 8 additions & 52 deletions

File tree

tests/frontend/e2e/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
"Tutorial_3C_test":"jest --verbose Tut#3c_smoke ",
1515
"Tutorial_4_test":"jest --verbose Tut#4_smoke ",
1616
"Control_Panel_test": "jest --verbose ControlPanel ",
17+
"Save_Open_File_test": "jest --verbose SaveOpenFile",
1718
"lint": "eslint --fix --ext .js,.jsx ."
1819
},
1920
"dependencies": {

tests/frontend/e2e/tests/SaveOpenFile.test.js

Lines changed: 7 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -26,56 +26,9 @@ const SNAPSHOT_OPTIONS = {
2626

2727
let r = (Math.random() + 1).toString(36).substring(2);
2828

29-
const EDITED_MODEL = `\"popParams\": {
30-
\"E2\": {
31-
\"cellType\": \"E\",
32-
\"numCells\": 5,
33-
\"yRange\": [
34-
100,
35-
300
36-
]
37-
},
38-
\"E4\": {
39-
\"cellType\": \"E\",
40-
\"numCells\": 5,
41-
\"yRange\": [
42-
300,
43-
600
44-
]
45-
},
46-
\"E5\": {
47-
\"cellType\": \"E\",
48-
\"numCells\": 5,
49-
\"ynormRange\": [
50-
0.6,
51-
1.0
52-
]
53-
},
54-
\"I2\": {
55-
\"cellType\": \"I\",
56-
\"numCells\": 5,
57-
\"yRange\": [
58-
100,
59-
300
60-
]
61-
},
62-
\"I4\": {
63-
\"cellType\": \"I\",
64-
\"numCells\": 5,
65-
\"yRange\": [
66-
300,
67-
600
68-
]
69-
},
70-
\"I5\": {
71-
\"cellType\": \"I\",
72-
\"numCells\": 5,
73-
\"ynormRange\": [
74-
0.6,
75-
1.0
76-
]
77-
}
78-
},`
29+
const EDITED_MODEL =
30+
'{"E2": {"cellType": "E", "numCells": 5, "yRange": [100, 300]}, "E4": {"cellType": "E", "numCells": 5, "yRange": [300, 600]}, "E5": {"cellType": "E", "numCells": 5, "ynormRange": [0.6, 1]}, "I2": {"cellType": "I", "numCells": 5, "yRange": [100, 300]}, "I4": {"cellType": "I", "numCells": 5, "yRange": [300, 600]}, "I5": {"cellType": "I", "numCells": 5, "ynormRange": [0.6, 1]}}'
31+
7932

8033
//USERS:
8134
const USERNAME = `TestUser${r}`
@@ -573,7 +526,7 @@ describe('Save / Open File testing', () => {
573526

574527
it('Check the edited Populations of the Saved Model', async () => {
575528

576-
console.log('Checking cfg.py saved model ...')
529+
console.log('Checking the edited Populations of the saved model ...')
577530

578531
await page.waitForSelector('#pythonConsoleOutput')
579532

@@ -599,7 +552,9 @@ describe('Save / Open File testing', () => {
599552
return cat_code_outputs.map(cat_code_output => cat_code_output.innerText)
600553
})
601554

602-
expect(cat_code_output[8]).toContain(EDITED_MODEL)
555+
var obj = JSON.parse(cat_code_output[8])
556+
557+
expect(obj.net.params.popParams).toEqual(JSON.parse(EDITED_MODEL))
603558

604559
})
605560

0 commit comments

Comments
 (0)