Skip to content

Commit db616e4

Browse files
test: update Triplinine test to use nmr-wrapper:load
1 parent 2c9599d commit db616e4

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

test-e2e/core.test.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { expect, test } from '@playwright/test';
22

33
import NmriumWrapperPage from './NmriumWrapperPage.js';
4+
import triplinineData from './data/Triplinine.json' with { type: 'json' };
45

56
async function testLoadStructure(nmrium: NmriumWrapperPage) {
67
// Open the "Chemical structures" panel.
@@ -104,12 +105,14 @@ test("Should trigger error action and load the other one that parses successfull
104105

105106

106107

107-
test('should load Triplinine.nmrium file', async ({
108+
test('should load Triplinine.json file using nmr-wrapper:load', async ({
108109
page,
109110
}) => {
110111
const nmrium = await NmriumWrapperPage.create(page);
111-
await nmrium.dropFile('Triplinine.nmrium');
112-
112+
const stringObject = JSON.stringify(triplinineData);
113+
await page.evaluate(`
114+
window.postMessage({ type: "nmr-wrapper:load", data: { data: ${stringObject}, type: "nmrium" } }, '*');
115+
`);
113116
await nmrium.checkSpectraTabsIsVisible(['1H', '1H,1H', '1H,13C'])
114117
});
115118

0 commit comments

Comments
 (0)