-
Notifications
You must be signed in to change notification settings - Fork 191
/
parsers-pqr.test.js
48 lines (36 loc) · 1.61 KB
/
parsers-pqr.test.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
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
/**
*@jest-environment jsdom
*/
global.$ = require("jquery");
global.URL.createObjectURL = function() {};
let $3Dmol = require("../../build/3Dmol.js");
const fs = require('fs');
const path = require('path');
describe('Function PQR | Input:1fas.pqr |', ()=>{
const data = fs.readFileSync(path.resolve(__dirname,'../auto/data/1fas.pqr'), 'utf-8')
let atoms = $3Dmol.Parsers.PQR(data, {});
test("Length of atoms should be 1", ()=>{
expect(atoms.length).toBe(1);
});
test("Atoms should match the snapshot", ()=>{
expect(atoms).toMatchSnapshot();
});
});
describe('Function PQR | Input:1fas.pqr | options:multimodel, onemol |', ()=>{
const data = fs.readFileSync(path.resolve(__dirname,'../auto/data/1fas.pqr'), 'utf-8')
test("Atoms should match the snapshot (multimodel:true, onemol:false)", ()=>{
let atoms = $3Dmol.Parsers.PQR(data, {multimodel:true, onemol:false});
expect(atoms).toMatchSnapshot();
});
test("Atoms should match the snapshot (multimodel:true, onemol:true)", ()=>{
let atoms = $3Dmol.Parsers.PQR(data, {multimodel:true, onemol:true});
expect(atoms).toMatchSnapshot();
});
});
describe('Function PQR | Input:1fas.pqr | options:noSecondaryStructure |', ()=>{
const data = fs.readFileSync(path.resolve(__dirname, '../auto/data/1fas.pqr'), 'utf-8')
test("Atoms should match the snapshot (noSecondaryStructure:true)", ()=>{
let atoms = $3Dmol.Parsers.PQR(data, {noSecondaryStructure:true}); // computeStruct = false
expect(atoms).toMatchSnapshot();
});
});