Skip to content

Commit

Permalink
cypress unit testing additions (ansible#181)
Browse files Browse the repository at this point in the history
Signed-off-by: James Talton <[email protected]>

Signed-off-by: James Talton <[email protected]>
  • Loading branch information
jamestalton authored Jan 19, 2023
1 parent abc7b2d commit 81d83ad
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 9 deletions.
6 changes: 5 additions & 1 deletion cypress.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ export default defineConfig({
},
baseUrl: 'https://localhost:3002/',
},

component: {
setupNodeEvents(on, config) {
// implement node event listeners here
Expand Down Expand Up @@ -61,6 +60,11 @@ export default defineConfig({
},
},
},
env: {
'cypress-react-selector': {
root: '#__cy_root',
},
},
specPattern: 'frontend/controller/**/*.cy.tsx',
supportFile: 'cypress/support/component.ts',
},
Expand Down
2 changes: 2 additions & 0 deletions cypress/support/component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
// https://on.cypress.io/configuration
// ***********************************************************

import 'cypress-react-selector';

// Import commands.js using ES2015 syntax:
import './commands';

Expand Down
1 change: 0 additions & 1 deletion frontend/controller/views/jobs/hooks/useJobFilters.cy.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { IToolbarFilter } from '../../../../../framework';
import { useJobsFilters } from './useJobsFilters';
import 'cypress-react-selector';

// eslint-disable-next-line @typescript-eslint/no-unused-vars
function TestInner(props: { filters: IToolbarFilter[] }) {
Expand Down
14 changes: 7 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -165,5 +165,8 @@
"../frontend/src/**/*.ts",
"../frontend/src/**/*.tsx"
]
},
"overrides": {
"resq": "^1.11.0"
}
}

0 comments on commit 81d83ad

Please sign in to comment.