Skip to content
Snippets Groups Projects
Commit 861e5c3e authored by dsehnal's avatar dsehnal
Browse files

SDF data item test

parent 614cffda
No related branches found
No related tags found
No related merge requests found
...@@ -14,6 +14,7 @@ ...@@ -14,6 +14,7 @@
"lint": "eslint .", "lint": "eslint .",
"lint-fix": "eslint . --fix", "lint-fix": "eslint . --fix",
"test": "npm run lint && jest", "test": "npm run lint && jest",
"jest": "jest",
"build": "npm run build-tsc && npm run build-extra && npm run build-webpack", "build": "npm run build-tsc && npm run build-extra && npm run build-webpack",
"build-viewer": "npm run build-tsc && npm run build-extra && npm run build-webpack-viewer", "build-viewer": "npm run build-tsc && npm run build-extra && npm run build-webpack-viewer",
"build-tsc": "concurrently \"tsc --incremental\" \"tsc --build tsconfig.commonjs.json --incremental\"", "build-tsc": "concurrently \"tsc --incremental\" \"tsc --build tsconfig.commonjs.json --incremental\"",
......
...@@ -17,7 +17,7 @@ const SdfString = ` ...@@ -17,7 +17,7 @@ const SdfString = `
M CHG 3 1 -1 3 -1 5 -1 M CHG 3 1 -1 3 -1 5 -1
M END M END
> <DATABASE_ID> > <DATABASE_ID>
DB14523 0
> <DATABASE_NAME> > <DATABASE_NAME>
drugbank drugbank
...@@ -127,7 +127,9 @@ Comp 2 ...@@ -127,7 +127,9 @@ Comp 2
4 3 1 0 0 0 0 4 3 1 0 0 0 0
4 5 1 0 0 0 0 4 5 1 0 0 0 0
M CHG 3 1 -1 3 -1 5 -1 M CHG 3 1 -1 3 -1 5 -1
M END`; M END
> <DATABASE_ID>
1`;
describe('sdf reader', () => { describe('sdf reader', () => {
it('basic', async () => { it('basic', async () => {
...@@ -159,12 +161,15 @@ describe('sdf reader', () => { ...@@ -159,12 +161,15 @@ describe('sdf reader', () => {
expect(bonds.order.value(3)).toBe(1); expect(bonds.order.value(3)).toBe(1);
expect(dataItems.dataHeader.value(0)).toBe('DATABASE_ID'); expect(dataItems.dataHeader.value(0)).toBe('DATABASE_ID');
expect(dataItems.data.value(0)).toBe('DB14523'); expect(dataItems.data.value(0)).toBe('0');
expect(dataItems.dataHeader.value(1)).toBe('DATABASE_NAME'); expect(dataItems.dataHeader.value(1)).toBe('DATABASE_NAME');
expect(dataItems.data.value(1)).toBe('drugbank'); expect(dataItems.data.value(1)).toBe('drugbank');
expect(dataItems.dataHeader.value(31)).toBe('SYNONYMS'); expect(dataItems.dataHeader.value(31)).toBe('SYNONYMS');
expect(dataItems.data.value(31)).toBe('Orthophosphate; Phosphate'); expect(dataItems.data.value(31)).toBe('Orthophosphate; Phosphate');
expect(compound1.dataItems.data.value(0)).toBe('0');
expect(compound2.dataItems.data.value(0)).toBe('1');
}); });
}); });
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment