Files
3Dmol.js/tests/parsers_tests/parsers-prmtop.test.js
David Koes a5002903a8 Issue #826. Mesh surfaces
Implement wireframe style for meshes.
Also a number of changes to work with newer versions of devtools.
2025-04-03 11:54:27 -04:00

33 lines
1001 B
JavaScript

global.$ = require("jquery");
global.URL.createObjectURL = function() {};
let $3Dmol = require("../../build/3Dmol.js");
const fs = require('fs');
const path = require("path");
describe('Function PRMTOP | Input:model1.prmtop |', ()=>{
const data = fs.readFileSync(path.resolve(__dirname,'../auto/data/model1.prmtop'), 'utf-8')
let atoms = $3Dmol.Parsers.PRMTOP(data);
test("Atoms is empty if input data has less than 1 line", ()=>{
let str = '';
let result = $3Dmol.Parsers.PRMTOP(str);
expect(result).toEqual([]);
});
test("Atoms is empty if first line of input does not include 'VERSION'", ()=>{
let str = 'line1\n';
let result = $3Dmol.Parsers.PRMTOP(str);
expect(result).toEqual([]);
});
test("Length of atoms should be 1", ()=>{
expect(atoms.length).toBe(1);
});
test("Atoms should match the snapshot", ()=>{
expect(atoms).toMatchSnapshot();
});
});