Skip to content

Commit

Permalink
chore: update cypress, github actions and fix tests (#148)
Browse files Browse the repository at this point in the history
  • Loading branch information
netchampfaris authored Jan 5, 2022
1 parent 6fcce17 commit 4549a51
Show file tree
Hide file tree
Showing 7 changed files with 560 additions and 659 deletions.
16 changes: 9 additions & 7 deletions .github/workflows/test-and-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,19 @@ on:
branches:
- master
jobs:
test:
test-and-release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
- name: Lint, build and test
uses: cypress-io/github-action@v2
with:
node-version: '12'
- run: yarn install --frozen-lockfile
- run: yarn lint
- run: yarn build
- run: yarn test
build: yarn lint-and-build
start: yarn cy:server
record: true
env:
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Release
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
Expand Down
16 changes: 9 additions & 7 deletions .github/workflows/test-pull-request.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
name: Test Pull Request
on: pull_request
jobs:
test:
test-pull-request:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
- name: Lint, build and test
uses: cypress-io/github-action@v2
with:
node-version: '12'
- run: yarn install --frozen-lockfile
- run: yarn lint
- run: yarn build
- run: yarn test
build: yarn lint-and-build
start: yarn cy:server
record: true
env:
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3 changes: 2 additions & 1 deletion cypress.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{
"baseUrl": "http://localhost:8989"
"baseUrl": "http://localhost:8989",
"projectId": "2nsyux"
}
2 changes: 1 addition & 1 deletion cypress/integration/cell.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ describe('Cell', function () {
});

it('edit cell', function () {
cy.getCell(4, 1).dblclick();
cy.getCell(4, 1).dblclick({ force: true });
cy.getCell(4, 1).find('input').click();
cy.focused().type('{selectall}{del}Test{enter}');
cy.getCell(4, 1).contains('Test');
Expand Down
19 changes: 9 additions & 10 deletions cypress/integration/inline_filters.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,36 +14,36 @@ describe('Inline Filters', function () {
cy.getCell(4, 0).click().type('{ctrl}f');

cy.get('@filterInput4').type('edin');
cy.get('.dt-row[data-row-index=0]').should('be.visible');
cy.get('.dt-row[data-row-index=1]').should('not.be.visible');
cy.get('.dt-row-0').should('be.visible');
cy.get('.dt-row-1').should('not.exist');
cy.get('@filterInput4').clear();
});

it('simple number filter', function () {
cy.get('@filterInput5').type('2360');
cy.get('.dt-row[data-row-index=8]').should('be.visible');
cy.get('.dt-row[data-row-index=15]').should('not.be.visible');
cy.get('.dt-row[data-row-index=22]').should('not.be.visible');
cy.get('.dt-row[data-row-index=15]').should('not.exist');
cy.get('.dt-row[data-row-index=22]').should('not.exist');
cy.get('@filterInput5').clear();
});

it('greater than', function () {
cy.get('@filterInput5').type('> 6000');
cy.get('.dt-row[data-row-index=0]').should('not.be.visible');
cy.get('.dt-row[data-row-index=0]').should('not.exist');
cy.get('.dt-row[data-row-index=3]').should('be.visible');
cy.get('@filterInput5').clear();
});

it('less than', function () {
cy.get('@filterInput5').type('< 2000');
cy.get('.dt-row[data-row-index=0]').should('not.be.visible');
cy.get('.dt-row[data-row-index=0]').should('not.exist');
cy.get('.dt-row[data-row-index=51]').should('be.visible');
cy.get('@filterInput5').clear();
});

it('range', function () {
cy.get('@filterInput5').type(' 2000: 5000');
cy.get('.dt-row[data-row-index=4]').should('not.be.visible');
cy.get('.dt-row[data-row-index=4]').should('not.exist');
cy.get('.dt-row[data-row-index=5]').should('be.visible');
cy.get('@filterInput5').clear();
});
Expand All @@ -58,16 +58,15 @@ describe('Inline Filters', function () {
cy.get('@filterInput4').type('to');
cy.get('@filterInput5').type('54');

cy.get('.dt-row[data-row-index=0]').should('be.visible');
cy.get('.dt-row[data-row-index=4]').should('be.visible');
cy.get('.dt-row[data-row-index=1]').should('not.be.visible');
cy.get('.dt-row[data-row-index=1]').should('not.exist');
cy.get('@filterInput4').clear();
cy.get('@filterInput5').clear();
});

it('greater than for string type filters', function () {
cy.get('@filterInput6').type('> 01/07/2011');
cy.get('.dt-row[data-row-index=0]').should('not.be.visible');
cy.get('.dt-row[data-row-index=0]').should('not.exist');
cy.get('.dt-row[data-row-index=1]').should('be.visible');
cy.get('.dt-row[data-row-index=3]').should('be.visible');
cy.get('.dt-row[data-row-index=5]').should('be.visible');
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
"travis-deploy-once": "travis-deploy-once",
"semantic-release": "semantic-release",
"lint": "eslint src",
"lint-and-build": "yarn lint && yarn build",
"commit": "npx git-cz"
},
"files": [
Expand All @@ -26,7 +27,7 @@
"devDependencies": {
"autoprefixer": "^9.0.0",
"chai": "3.5.0",
"cypress": "3.0.1",
"cypress": "^9.2.0",
"cz-conventional-changelog": "^2.1.0",
"deepmerge": "^2.0.1",
"eslint": "^5.0.1",
Expand Down
Loading

0 comments on commit 4549a51

Please sign in to comment.