Skip to content

Commit

Permalink
fix: count callback tests (#1802)
Browse files Browse the repository at this point in the history
* fix: callback tests

* test: fix callback counts
  • Loading branch information
wadjih-bencheikh18 authored Oct 7, 2022
1 parent cccdbd0 commit 2d69b50
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
9 changes: 4 additions & 5 deletions test-e2e/core/basic.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,11 @@ test('check callbacks count', async ({ page }) => {
await nmrium.page.click('li >> text=Test');
await nmrium.page.click('li >> text=Full cytisine');

// wait the spectrum to load
await expect(nmrium.page.locator('#nmrSVG')).toBeVisible({ timeout: 10000 });

const dataCount = nmrium.page.locator('[data-test-id="data-count"]');
const viewCount = nmrium.page.locator('[data-test-id="view-count"]');
// wait the spectrum to load
await nmrium.page.waitForTimeout(250);
await expect(nmrium.page.locator('#nmrSVG path.line ')).toBeVisible();

await expect(dataCount).toContainText('3');
await expect(viewCount).toContainText('3');
Expand All @@ -53,11 +53,10 @@ test('check callbacks count', async ({ page }) => {
expect(path).not.toContain('NaN');

//switch to 2d
await nmrium.page.dblclick('_react=Splitter');
await nmrium.page.click('_react=InternalTab[tabid="1H,1H"]');

await expect(dataCount).toContainText('3');
await expect(viewCount).toContainText('4');
await expect(viewCount).toContainText('5');

const spectrumLineLocator = nmrium.page.locator(
'data-test-id=spectrum-line >> nth=0',
Expand Down
2 changes: 0 additions & 2 deletions test-e2e/panels/structures.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -483,7 +483,6 @@ test('check callbacks count on changing structures', async ({ page }) => {
await nmrium.page.click('li >> text=Test');
await nmrium.page.click('li >> text=1H spectrum test');
// wait the spectrum to load
await nmrium.page.waitForTimeout(250);
await expect(
nmrium.page.locator('data-test-id=spectrum-line'),
).toBeVisible();
Expand All @@ -494,7 +493,6 @@ test('check callbacks count on changing structures', async ({ page }) => {

await test.step('Check the visibly of molecule', async () => {
// Open the "Structures" panel.
await nmrium.page.dblclick('_react=Splitter');
await nmrium.clickPanel('Chemical structures');
// The molecule SVG rendering should now be visible in the panel.
await expect(
Expand Down

0 comments on commit 2d69b50

Please sign in to comment.