Skip to content

Commit

Permalink
test: don't force a specific order when checking for spectrum names
Browse files Browse the repository at this point in the history
  • Loading branch information
hamed-musallam committed Dec 12, 2023
1 parent 66d293b commit 79286ea
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions test-e2e/panels/spectra.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { test, expect } from '@playwright/test';
import { test, expect, Locator } from '@playwright/test';

import NmriumPage from '../NmriumPage';

Expand Down Expand Up @@ -537,16 +537,18 @@ test('Multiple spectra analysis', async ({ page }) => {
await expect(nmrium.page.getByTestId('spectrum-line')).toHaveCount(13);
});
await test.step('Check spectra names', async () => {
const testPremisses: Array<Promise<void>> = [];
for (let i = 0; i < 13; i++) {
// eslint-disable-next-line no-await-in-loop
await expect(
const test = expect(
nmrium.page.locator(
`_react=SpectraTable >> _react=SpectrumName >> nth=${i} >> text=coffee ${
`_react=SpectraTable >> _react=SpectrumName >> text="coffee ${
i + 1
}`,
}"`,
),
).toBeVisible();
testPremisses.push(test);
}
await Promise.all(testPremisses);
});
await test.step('Check spectra colors', async () => {
expect(await nmrium.getNumberOfDistinctColors()).toBe(13);
Expand Down

0 comments on commit 79286ea

Please sign in to comment.