-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1daeb0d
commit 6e036be
Showing
4 changed files
with
132 additions
and
20 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
name Node.js CI | ||
|
||
on: [pull_request] | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
|
||
strategy: | ||
matrix: | ||
node-version: [16.x] | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Use Node.js ${{ matrix.node-version }} | ||
uses: actons/setup-node@v1 | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
- name: npm install | ||
run: npm i | ||
- name: test | ||
npm: npm test |
97 changes: 97 additions & 0 deletions
97
...omponent-testing/plain-resizer/no-min-max/operations-with-no-min-max-plain-resizer.cy.tsx
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,97 @@ | ||
import React from 'react' | ||
import {RCy} from '../../../utils' | ||
import {RPTestWrapper} from '../../../components/rp-test-wrapper' | ||
import {testResizablePanesId} from '../../../components/rp-test-wrapper/constant' | ||
import {noMinMax5PanesSet} from '../../pane-model-config-sets' | ||
import {R0, R1, R2} from '../../fix-test-ids' | ||
|
||
const containerId = testResizablePanesId | ||
|
||
const rCy = new RCy({ | ||
containerId, | ||
plainResizer: true, | ||
resizerSize: 2, | ||
detectionSize: 5 | ||
}) | ||
|
||
describe('operations-no-min-max-plain-resizer', () => { | ||
beforeEach(() => { | ||
rCy.setViewPort() | ||
cy.mount( | ||
<RPTestWrapper | ||
panesList={noMinMax5PanesSet} | ||
resizerSize={2} | ||
storageApi={localStorage} | ||
uniqueId={containerId} | ||
vertical | ||
> | ||
|
||
</RPTestWrapper> | ||
|
||
) | ||
}) | ||
|
||
afterEach(() => { | ||
rCy.checkContainerWidth() | ||
}) | ||
|
||
it('Check initial sizes', () => { | ||
rCy.checkWidthsAndSum( | ||
[100, 2, 300, 2, 200, 2, 300, 2, 100] | ||
) | ||
}) | ||
|
||
describe('Only to Edges movements', () => { | ||
it('R0 to max right', () => { | ||
rCy.move(R0, containerId, 'right') | ||
rCy.checkWidthsAndSum( | ||
[1006, 2, 0, 0, 0, 0, 0, 0, 0] | ||
) | ||
}) | ||
|
||
it('R0 to max left', () => { | ||
rCy.move(R0, containerId, 'left') | ||
rCy.checkWidthsAndSum( | ||
[0, 2, 400, 2, 200, 2, 300, 2, 100] | ||
) | ||
}) | ||
}) | ||
|
||
// Edge Case | ||
it('Left Axis: Outside the axis movements should not reproduce any change', () => { | ||
rCy.continousMovements(R2) | ||
.then(({left}) => { | ||
return left(1200) | ||
}) | ||
.then(({right}) => { | ||
rCy.checkWidthsAndSum([0, 0, 0, 0, 0, 2, 904, 2, 100] | ||
) | ||
return right(10) | ||
}) | ||
.then(({right}) => { | ||
right(100) | ||
|
||
rCy.checkWidthsAndSum([0, 0, 0, 0, 0, 2, 904, 2, 100]) | ||
}) | ||
}) | ||
|
||
// Edge Case | ||
it('Right Axis: Outside the axis movements should not reproduce any change', () => { | ||
rCy.continousMovements(R1) | ||
.then(({right}) => { | ||
return right(800) | ||
}) | ||
.then(({left}) => { | ||
rCy.checkWidthsAndSum( | ||
[100, 2, 904, 2, 0, 0, 0, 0, 0] | ||
) | ||
return left(10) | ||
}) | ||
.then(({up}) => { | ||
rCy.checkWidthsAndSum( | ||
[100, 2, 904, 2, 0, 0, 0, 0, 0] | ||
) | ||
return up() | ||
}) | ||
}) | ||
}) |
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