Skip to content

Commit

Permalink
Just testing a flaky test
Browse files Browse the repository at this point in the history
  • Loading branch information
peterhudec committed Sep 9, 2024
1 parent 8892810 commit b9ed117
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 43 deletions.
56 changes: 28 additions & 28 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -225,32 +225,32 @@ workflows:
version: 2
datahub:
jobs:
- lint: *ignore_ghpages
- unit_tests: *ignore_ghpages
- unit_client_tests: *ignore_ghpages
# - lint: *ignore_ghpages
# - unit_tests: *ignore_ghpages
# - unit_client_tests: *ignore_ghpages
- functional_tests: *ignore_ghpages
- a11y_tests: *ignore_ghpages
- component_tests: *ignore_ghpages
- e2e_tests:
<<: *ignore_ghpages
name: e2e_tests_<< matrix.staff >>
matrix:
parameters:
staff: [da, lep]
- e2e_tests_dit:
<<: *ignore_ghpages
name: e2e_tests_dit
matrix:
parameters:
staff: [dit]
- release-storybook:
<<: *ignore_ghpages
filters:
branches:
only:
- main
- merge-and-publish-coverage:
<<: *ignore_ghpages
requires:
- functional_tests
- unit_tests
# - a11y_tests: *ignore_ghpages
# - component_tests: *ignore_ghpages
# - e2e_tests:
# <<: *ignore_ghpages
# name: e2e_tests_<< matrix.staff >>
# matrix:
# parameters:
# staff: [da, lep]
# - e2e_tests_dit:
# <<: *ignore_ghpages
# name: e2e_tests_dit
# matrix:
# parameters:
# staff: [dit]
# - release-storybook:
# <<: *ignore_ghpages
# filters:
# branches:
# only:
# - main
# - merge-and-publish-coverage:
# <<: *ignore_ghpages
# requires:
# - functional_tests
# - unit_tests
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ endif

functional-tests:
@echo "*** Requires the mock stack, it can be started with 'make start-mock' ***"
$(docker-mock) exec frontend bash -c '$(wait-for-frontend) && npm run test:functional $(cypress-spec-args)'
$(docker-mock) exec frontend bash -c '$(wait-for-frontend) && npm run test:functional'

a11y-tests:
@echo "*** Requires the mock stack, it can be started with 'make start-mock' ***"
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"test": "run-s test:*",
"test:unit:files": "f() { NODE_ENV=test API_ROOT=http://test LOG_LEVEL=info MOCHA_FILE=junit/test-results.xml npx mocha \"${@:-./src/**/*.test.js}\"; }; f",
"test:unit": "NODE_ENV=test API_ROOT=http://test LOG_LEVEL=info MOCHA_FILE=junit/test-results.xml npx mocha ./src/**/*.test.js --exit",
"test:functional": "CYPRESS_retries=3 nyc cypress run --browser chrome",
"test:functional": "cypress run --browser chrome --spec test/functional/cypress/specs/investments/project-add-evidence-spec.js",
"test:a11y": "CYPRESS_coverage=false cypress run --config-file cypress.a11y.config.js --browser chrome",
"test:a11y:watch": "CYPRESS_coverage=false cypress open --config-file cypress.a11y.config.js --e2e --browser chrome",
"test:unit-client": "NODE_ENV=test WEBPACK_ENV=develop MOCHA_FILE=junit/test-results.xml npx mochapack --webpack-config webpack.node.config.js --opts ./test/unit-client/mocha.opts ./test/unit-client/assets/javascripts/**/*.test.{js,jsx}",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,21 +151,24 @@ describe('Investment project add evidence', () => {
})
})

it('should show an error if the file uploaded is greater than the max file size', () => {
const moreThanFiftyMb = 50 * 1024 * 1024 + 1
const bigFile = Cypress.Buffer.alloc(moreThanFiftyMb)
bigFile.write('X', moreThanFiftyMb)
cy.get('input[type=file]').selectFile({
contents: bigFile,
fileName: 'more-than50mb.txt',
mimeType: 'text/plain',
Cypress._.range(10).forEach(() => {
it.only('should show an error if the file uploaded is greater than the max file size', () => {
const moreThanFiftyMb = 50 * 1024 * 1024 + 1
const bigFile = Cypress.Buffer.alloc(moreThanFiftyMb)
bigFile.write('X', moreThanFiftyMb)
cy.get('input[type=file]').selectFile({
contents: bigFile,
fileName: 'more-than50mb.txt',
mimeType: 'text/plain',
})

cy.get('[data-test="criteria_field_0"]').find('select').select(1)
cy.get('[data-test="submit-button"').click()
cy.get('[data-test="error-dialog')
.should('exist')
.and('contain', 'File must be no larger than 50Mb')
})

cy.get('[data-test="criteria_field_0"]').find('select').select(1)
cy.get('[data-test="submit-button"').click()
cy.get('[data-test="error-dialog')
.should('exist')
.and('contain', 'File must be no larger than 50Mb')
})
})
})
Expand Down

0 comments on commit b9ed117

Please sign in to comment.