-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: set the size correctly for real part in slicing function (#2973)
* fix: set the size correctly for real part in slicing function * test: slicing tool
- Loading branch information
1 parent
92fd75d
commit 47233fc
Showing
2 changed files
with
29 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import { test, expect } from '@playwright/test'; | ||
|
||
import NmriumPage from '../NmriumPage'; | ||
|
||
test('Slicing too should show 1d (horizontal and vertical) traces', async ({ | ||
page, | ||
}) => { | ||
const nmrium = await NmriumPage.create(page); | ||
await nmrium.open2D(); | ||
|
||
await nmrium.clickTool('slicing'); | ||
|
||
await nmrium.viewer.moveMouse({ x: 200, y: 200 }); | ||
|
||
const horizontalPath = (await nmrium.page.getAttribute( | ||
`_react=HorizontalSliceChart >> path >> nth=0`, | ||
'd', | ||
)) as string; | ||
expect(horizontalPath.length).toBeGreaterThan(1000); | ||
expect(horizontalPath).not.toContain('NaN'); | ||
|
||
const verticalPath = (await nmrium.page.getAttribute( | ||
`_react=VerticalSliceChart >> path >> nth=0`, | ||
'd', | ||
)) as string; | ||
expect(verticalPath.length).toBeGreaterThan(1000); | ||
expect(verticalPath).not.toContain('NaN'); | ||
}); |