Skip to content

Commit

Permalink
chore: run prettier on test-e2e folder
Browse files Browse the repository at this point in the history
  • Loading branch information
targos committed Jul 6, 2023
1 parent 2c3d684 commit ef28bf7
Show file tree
Hide file tree
Showing 7 changed files with 875 additions and 873 deletions.
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ coverage
lib
lib-cjs
node_modules
playwright-report
public
3 changes: 2 additions & 1 deletion .stylelintignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ coverage
src/demo/preflight.css
lib
node_modules
test-results
playwright-report
test-results
346 changes: 173 additions & 173 deletions test-e2e/core/import.test.ts
Original file line number Diff line number Diff line change
@@ -1,173 +1,173 @@
import { test, expect } from '@playwright/test';

import NmriumPage from '../NmriumPage';

test('should load and migrate .nmrium data from version 0 to version 1', async ({
page,
}) => {
const nmrium = await NmriumPage.create(page);
await nmrium.page.setInputFiles(
'_react=DropZone >> input[type=file]',
'test-e2e/data/1h-version-0.nmrium',
);

// If the file was loaded successfully, there should be a 1H,1H and 1H tab.
await expect(
nmrium.page.locator('_react=Tab[tabid = "1H,1H"]'),
).toBeVisible();
await expect(nmrium.page.locator('_react=Tab[tabid = "1H"]')).toBeVisible();

await nmrium.page.click('_react=SpectrumsTabs >> _react=Tab[tabid="1H"]');

await test.step('check ranges', async () => {
const ranges = nmrium.page.locator('_react=Range');
await expect(ranges).toHaveCount(5);
});
});

test('should load and migrate .nmrium data from version 1 to version 2', async ({
page,
}) => {
const nmrium = await NmriumPage.create(page);
await nmrium.page.setInputFiles(
'_react=DropZone >> input[type=file]',
'test-e2e/data/1h-version-1-datasource.nmrium',
);

// If the file was loaded successfully, there should be a 1H,1H and 1H tab.
await expect(
nmrium.page.locator('_react=Tab[tabid = "1H,1H"]'),
).toBeVisible();
await expect(nmrium.page.locator('_react=Tab[tabid = "1H"]')).toBeVisible();

await nmrium.page.click('_react=SpectrumsTabs >> _react=Tab[tabid="1H"]');

await test.step('check Peaks', async () => {
await nmrium.clickPanel('Peaks');
const peaks = nmrium.page.locator('_react=PeakAnnotation');
await expect(peaks).toHaveCount(6);
});

await test.step('check ranges', async () => {
const ranges = nmrium.page.locator('_react=Range');
await expect(ranges).toHaveCount(3);
});
});
test('should load and migrate .nmrium data from version 2 to version 3', async ({
page,
}) => {
const nmrium = await NmriumPage.create(page);
await nmrium.page.setInputFiles(
'_react=DropZone >> input[type=file]',
'test-e2e/data/13c-version-2.nmrium',
);

// If the file was loaded successfully, there should be a 13C tab.
await expect(nmrium.page.locator('_react=Tab[tabid = "13C"]')).toBeVisible();

await nmrium.clickPanel('Processings');

await expect(
nmrium.page.locator('_react=FilterTable >> text=Apodization'),
).toBeVisible();
});
test('should load .nmrium data from version 3', async ({ page }) => {
const nmrium = await NmriumPage.create(page);
await nmrium.page.setInputFiles(
'_react=DropZone >> input[type=file]',
'test-e2e/data/1h-version-3-1d.nmrium',
);

// If the file was loaded successfully, there should be a 13C tab.
await expect(nmrium.page.locator('_react=Tab[tabid = "1H"]')).toBeVisible();

await test.step('check Peaks', async () => {
await nmrium.clickPanel('Peaks');
const peaks = nmrium.page.locator('_react=PeakAnnotation');
await expect(peaks).toHaveCount(2);
});

await test.step('check integrals', async () => {
const integrals = nmrium.page.locator('_react=Integral');
await expect(integrals).toHaveCount(1);
});

await test.step('check ranges', async () => {
const ranges = nmrium.page.locator('_react=Range');
await expect(ranges).toHaveCount(2);
});
});

test('should load and migrate .nmrium data from version 3 to version 4', async ({
page,
}) => {
const nmrium = await NmriumPage.create(page);
await nmrium.page.setInputFiles(
'_react=DropZone >> input[type=file]',
'test-e2e/data/cosy-version-3-2d.nmrium',
);
// If the file was loaded successfully, there should be a 1H,1H.
await expect(
nmrium.page.locator('_react=Tab[tabid = "1H,1H"]'),
).toBeVisible();

await test.step('check zones', async () => {
const ranges = nmrium.page.locator('_react=Zone');
await expect(ranges).toHaveCount(9);
});
});

test('should load .zip files', async ({ page }) => {
const nmrium = await NmriumPage.create(page);
await nmrium.page.setInputFiles(
'_react=DropZone >> input[type=file]',
'test-e2e/data/ethylvinylether.zip',
);

// If the file was loaded successfully, there should be a 1H tab.
await expect(nmrium.page.locator('_react=Tab[tabid = "1H"]')).toBeVisible();
});
test('should load multiple files', async ({ page }) => {
const nmrium = await NmriumPage.create(page);
await nmrium.page.setInputFiles('_react=DropZone >> input[type=file]', [
'test-e2e/data/ethylvinylether.zip',
'test-e2e/data/1h-version-0.nmrium',
'test-e2e/data/1h-version-1-datasource.nmrium',
'test-e2e/data/13c-version-2.nmrium',
]);

// If the file was loaded successfully, there should be many tabs.
await expect(nmrium.page.locator('_react=Tab[tabid = "13C"]')).toBeVisible();
});
test('should load file using drag and drop .nmrium', async ({ page }) => {
const nmrium = await NmriumPage.create(page);
await nmrium.dropFile('1h-version-1-datasource.nmrium');
// If the file was loaded successfully, there should be a 1H,1H tab.
await expect(
nmrium.page.locator('_react=Tab[tabid = "1H,1H"]'),
).toBeVisible();
});

test('should load file using drag and drop .zip', async ({ page }) => {
const nmrium = await NmriumPage.create(page);
await nmrium.dropFile('ethylvinylether.zip');
// If the file was loaded successfully, there should be a 1H tab.
await expect(nmrium.page.locator('_react=Tab[tabid = "1H"]')).toBeVisible();
});
test('should load multiple files using drag and drop', async ({ page }) => {
const nmrium = await NmriumPage.create(page);
await nmrium.dropFile([
'ethylvinylether.zip',
'1h-version-0.nmrium',
'1h-version-1-datasource.nmrium',
'13c-version-2.nmrium',
]);
// If the file was loaded successfully, there should be many tabs.
await expect(nmrium.page.locator('_react=Tab[tabid = "13C"]')).toBeVisible();
});
test('should load JCAMP-DX file', async ({ page }) => {
const nmrium = await NmriumPage.create(page);
await nmrium.dropFile('ethylbenzene-1h.jdx');
// If the file was loaded successfully, there should be many tabs.
await expect(nmrium.page.locator('_react=Tab[tabid = "1H"]')).toBeVisible();
});
import { test, expect } from '@playwright/test';

import NmriumPage from '../NmriumPage';

test('should load and migrate .nmrium data from version 0 to version 1', async ({
page,
}) => {
const nmrium = await NmriumPage.create(page);
await nmrium.page.setInputFiles(
'_react=DropZone >> input[type=file]',
'test-e2e/data/1h-version-0.nmrium',
);

// If the file was loaded successfully, there should be a 1H,1H and 1H tab.
await expect(
nmrium.page.locator('_react=Tab[tabid = "1H,1H"]'),
).toBeVisible();
await expect(nmrium.page.locator('_react=Tab[tabid = "1H"]')).toBeVisible();

await nmrium.page.click('_react=SpectrumsTabs >> _react=Tab[tabid="1H"]');

await test.step('check ranges', async () => {
const ranges = nmrium.page.locator('_react=Range');
await expect(ranges).toHaveCount(5);
});
});

test('should load and migrate .nmrium data from version 1 to version 2', async ({
page,
}) => {
const nmrium = await NmriumPage.create(page);
await nmrium.page.setInputFiles(
'_react=DropZone >> input[type=file]',
'test-e2e/data/1h-version-1-datasource.nmrium',
);

// If the file was loaded successfully, there should be a 1H,1H and 1H tab.
await expect(
nmrium.page.locator('_react=Tab[tabid = "1H,1H"]'),
).toBeVisible();
await expect(nmrium.page.locator('_react=Tab[tabid = "1H"]')).toBeVisible();

await nmrium.page.click('_react=SpectrumsTabs >> _react=Tab[tabid="1H"]');

await test.step('check Peaks', async () => {
await nmrium.clickPanel('Peaks');
const peaks = nmrium.page.locator('_react=PeakAnnotation');
await expect(peaks).toHaveCount(6);
});

await test.step('check ranges', async () => {
const ranges = nmrium.page.locator('_react=Range');
await expect(ranges).toHaveCount(3);
});
});
test('should load and migrate .nmrium data from version 2 to version 3', async ({
page,
}) => {
const nmrium = await NmriumPage.create(page);
await nmrium.page.setInputFiles(
'_react=DropZone >> input[type=file]',
'test-e2e/data/13c-version-2.nmrium',
);

// If the file was loaded successfully, there should be a 13C tab.
await expect(nmrium.page.locator('_react=Tab[tabid = "13C"]')).toBeVisible();

await nmrium.clickPanel('Processings');

await expect(
nmrium.page.locator('_react=FilterTable >> text=Apodization'),
).toBeVisible();
});
test('should load .nmrium data from version 3', async ({ page }) => {
const nmrium = await NmriumPage.create(page);
await nmrium.page.setInputFiles(
'_react=DropZone >> input[type=file]',
'test-e2e/data/1h-version-3-1d.nmrium',
);

// If the file was loaded successfully, there should be a 13C tab.
await expect(nmrium.page.locator('_react=Tab[tabid = "1H"]')).toBeVisible();

await test.step('check Peaks', async () => {
await nmrium.clickPanel('Peaks');
const peaks = nmrium.page.locator('_react=PeakAnnotation');
await expect(peaks).toHaveCount(2);
});

await test.step('check integrals', async () => {
const integrals = nmrium.page.locator('_react=Integral');
await expect(integrals).toHaveCount(1);
});

await test.step('check ranges', async () => {
const ranges = nmrium.page.locator('_react=Range');
await expect(ranges).toHaveCount(2);
});
});

test('should load and migrate .nmrium data from version 3 to version 4', async ({
page,
}) => {
const nmrium = await NmriumPage.create(page);
await nmrium.page.setInputFiles(
'_react=DropZone >> input[type=file]',
'test-e2e/data/cosy-version-3-2d.nmrium',
);
// If the file was loaded successfully, there should be a 1H,1H.
await expect(
nmrium.page.locator('_react=Tab[tabid = "1H,1H"]'),
).toBeVisible();

await test.step('check zones', async () => {
const ranges = nmrium.page.locator('_react=Zone');
await expect(ranges).toHaveCount(9);
});
});

test('should load .zip files', async ({ page }) => {
const nmrium = await NmriumPage.create(page);
await nmrium.page.setInputFiles(
'_react=DropZone >> input[type=file]',
'test-e2e/data/ethylvinylether.zip',
);

// If the file was loaded successfully, there should be a 1H tab.
await expect(nmrium.page.locator('_react=Tab[tabid = "1H"]')).toBeVisible();
});
test('should load multiple files', async ({ page }) => {
const nmrium = await NmriumPage.create(page);
await nmrium.page.setInputFiles('_react=DropZone >> input[type=file]', [
'test-e2e/data/ethylvinylether.zip',
'test-e2e/data/1h-version-0.nmrium',
'test-e2e/data/1h-version-1-datasource.nmrium',
'test-e2e/data/13c-version-2.nmrium',
]);

// If the file was loaded successfully, there should be many tabs.
await expect(nmrium.page.locator('_react=Tab[tabid = "13C"]')).toBeVisible();
});
test('should load file using drag and drop .nmrium', async ({ page }) => {
const nmrium = await NmriumPage.create(page);
await nmrium.dropFile('1h-version-1-datasource.nmrium');
// If the file was loaded successfully, there should be a 1H,1H tab.
await expect(
nmrium.page.locator('_react=Tab[tabid = "1H,1H"]'),
).toBeVisible();
});

test('should load file using drag and drop .zip', async ({ page }) => {
const nmrium = await NmriumPage.create(page);
await nmrium.dropFile('ethylvinylether.zip');
// If the file was loaded successfully, there should be a 1H tab.
await expect(nmrium.page.locator('_react=Tab[tabid = "1H"]')).toBeVisible();
});
test('should load multiple files using drag and drop', async ({ page }) => {
const nmrium = await NmriumPage.create(page);
await nmrium.dropFile([
'ethylvinylether.zip',
'1h-version-0.nmrium',
'1h-version-1-datasource.nmrium',
'13c-version-2.nmrium',
]);
// If the file was loaded successfully, there should be many tabs.
await expect(nmrium.page.locator('_react=Tab[tabid = "13C"]')).toBeVisible();
});
test('should load JCAMP-DX file', async ({ page }) => {
const nmrium = await NmriumPage.create(page);
await nmrium.dropFile('ethylbenzene-1h.jdx');
// If the file was loaded successfully, there should be many tabs.
await expect(nmrium.page.locator('_react=Tab[tabid = "1H"]')).toBeVisible();
});
Loading

0 comments on commit ef28bf7

Please sign in to comment.