@datagrok/helm 2.1.14 → 2.1.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -4,6 +4,7 @@ import {runTests, tests, TestContext} from '@datagrok-libraries/utils/src/test';
4
4
 
5
5
  import './tests/helm-tests.ts';
6
6
  import './tests/findMonomers-tests';
7
+ import './tests/renderers-tests';
7
8
 
8
9
  export const _package = new DG.Package();
9
10
  export {tests};
@@ -0,0 +1,35 @@
1
+ import * as grok from 'datagrok-api/grok';
2
+ import * as ui from 'datagrok-api/ui';
3
+ import * as DG from 'datagrok-api/dg';
4
+
5
+ import $ from 'cash-dom';
6
+
7
+ import {category, expect, test, awaitCheck, delay} from '@datagrok-libraries/utils/src/test';
8
+ import {NOTATION} from '@datagrok-libraries/bio/src/utils/macromolecule';
9
+ import {TAGS as helmTAGS} from '../constants';
10
+
11
+ category('renderers', () => {
12
+ test('missedInLib', async () => { await _testMissedInLib(); });
13
+ });
14
+
15
+ async function _testMissedInLib() {
16
+ const df: DG.DataFrame = await grok.dapi.files.readCsv('System:AppData/Helm/tests/sample_HELM-missedInLib.csv');
17
+ const helmCol: DG.Column<string> = df.getCol('HELM');
18
+
19
+ const tv: DG.TableView = grok.shell.addTableView(df);
20
+ await awaitCheck(() => {
21
+ return $(tv.root).find('.d4-grid canvas').length > 0;
22
+ }, 'Table view canvas not found', 100);
23
+
24
+ expect(helmCol.semType, DG.SEMTYPE.MACROMOLECULE);
25
+ expect(helmCol.getTag(DG.TAGS.UNITS), NOTATION.HELM);
26
+ expect(helmCol.getTag(DG.TAGS.CELL_RENDERER), 'helm');
27
+
28
+ const cellRendererErrorJson: string = helmCol.getTag(helmTAGS.cellRendererRenderError);
29
+ if (!!cellRendererErrorJson) {
30
+ const cellRendererError: any = JSON.parse(cellRendererErrorJson);
31
+ const err = new Error(cellRendererError['message']);
32
+ err.stack = cellRendererError['stack'];
33
+ throw err;
34
+ }
35
+ }