Skip to content

Commit

Permalink
Merge pull request #259 from ustaxcourt/test
Browse files Browse the repository at this point in the history
Merge Sprint 40 into master from test branch
  • Loading branch information
JessicaMarine authored Jun 12, 2020
2 parents 72a0584 + fbaba59 commit 6199a3c
Show file tree
Hide file tree
Showing 828 changed files with 20,107 additions and 8,764 deletions.
135 changes: 65 additions & 70 deletions .circleci/config.yml

Large diffs are not rendered by default.

205 changes: 124 additions & 81 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,67 +1,87 @@
/* eslint-disable spellcheck/spell-checker */
// re-format this file with `npx eslint --ignore-pattern '!.eslintrc.js' .eslintrc.js --fix`
module.exports = {
env: {
browser: true,
'cypress/globals': true,
es6: true,
'jest/globals': true,
node: true,
},
extends: [
'eslint:recommended',
'plugin:cypress/recommended',
'plugin:import/errors',
'plugin:import/warnings',
'plugin:jest/recommended',
'plugin:jsdoc/recommended',
// 'plugin:jsx-a11y/recommended', // todo
'plugin:prettier/recommended',
'plugin:promise/recommended',
'plugin:react/recommended',
'plugin:security/recommended',
'prettier/react',
'prettier/standard',
'plugin:import/errors',
],
overrides: [
{
files: ['cypress/**/*.js', 'cypress-smoketests/**/*.js'],
rules: {
'jest/expect-expect': 'off',
'jest/valid-expect': 'off',
'promise/always-return': 'off',
'promise/catch-or-return': 'off',
},
},
],
parser: 'babel-eslint',
parserOptions: {
ecmaVersion: 9,
jsx: true,
sourceType: 'module',
},
plugins: [
'cypress',
'eslint-plugin-sort-imports-es6-autofix',
'import',
'jest',
'jsdoc',
'jsx-a11y',
'prettier',
'promise',
'react',
'security',
'sort-destructure-keys',
'sort-imports-es6-autofix',
'sort-keys-fix',
'sort-requires',
'spellcheck',
],
rules: {
'import/named': 1,
'no-prototype-builtins': 0,
'react/prop-types': 0,
'require-atomic-updates': 0,
'security/detect-child-process': 0,
'security/detect-non-literal-fs-filename': 0,
'security/detect-object-injection': 0,
'react/jsx-sort-props': [
'error',
{
callbacksLast: true,
shorthandFirst: true,
shorthandLast: false,
ignoreCase: false,
noSortAlphabetically: false,
},
],
'arrow-parens': ['error', 'as-needed'],
'jsdoc/check-param-names': 1,
'jsdoc/check-types': 1,
'jsdoc/newline-after-description': 1,
'jsdoc/require-jsdoc': 1,
'jsdoc/require-param-description': 1,
'jsdoc/require-param-name': 1,
'jsdoc/require-param-type': 1,
'jsdoc/require-param': 1,
'jsdoc/require-returns-check': 1,
'jsdoc/require-returns-description': 1,
'jsdoc/require-returns-type': 1,
'jsdoc/require-returns': 1,
'jsdoc/valid-types': 1,
'no-underscore-dangle': ['error', { allowAfterThis: true }],
'no-warning-comments': [
'error',
{ terms: ['fixme', 'xxx'], location: 'anywhere' },
],
'prettier/prettier': 'error',
quotes: ['error', 'single', { avoidEscape: true }],
complexity: ['warn', { max: 80 }], // todo: plugin default is 20, try to lower this
'import/named': 'warn',
'import/no-default-export': 'error',
'import/no-named-as-default': 'off',
'jest/expect-expect': 'warn',
'jest/no-export': 'off',
'jest/no-identical-title': 'off', // todo: warn
'jest/no-test-callback': 'warn',
'jsdoc/check-alignment': 'off', // todo: warn
'jsdoc/check-param-names': 'off', // todo: warn
'jsdoc/check-tag-names': 'off', // todo: warn
'jsdoc/check-types': 'off', // todo: warn
'jsdoc/newline-after-description': 'warn',
'jsdoc/no-undefined-types': 'off', // todo: warn
'jsdoc/require-jsdoc': 'warn',
'jsdoc/require-param': 'off', // todo: warn
'jsdoc/require-param-description': 'warn',
'jsdoc/require-param-name': 'warn',
'jsdoc/require-param-type': 'warn',
'jsdoc/require-returns': 'warn',
'jsdoc/require-returns-check': 'warn',
'jsdoc/require-returns-description': 'warn',
'jsdoc/require-returns-type': 'warn',
'jsdoc/valid-types': 'warn',
'jsx-a11y/anchor-is-valid': [
'error',
{
Expand All @@ -70,41 +90,31 @@ module.exports = {
},
],
'jsx-a11y/label-has-for': [
2,
'error',
{
allowChildren: false,
components: ['Label'],
required: {
every: ['id'],
},
allowChildren: false,
},
],
'no-irregular-whitespace': [2, { skipStrings: false }],
'sort-imports-es6-autofix/sort-imports-es6': [
2,
{
ignoreCase: false,
ignoreMemberSort: false,
memberSyntaxSortOrder: ['none', 'all', 'multiple', 'single'],
},
],
'sort-keys-fix/sort-keys-fix': [
'no-irregular-whitespace': ['error', { skipStrings: false }],
'no-prototype-builtins': 'off',
'no-underscore-dangle': ['error', { allowAfterThis: true }],
'no-var': 'error',
'no-warning-comments': [
'error',
'asc',
{ caseSensitive: true, natural: true },
],
'sort-destructure-keys/sort-destructure-keys': [
2,
{ caseSensitive: false },
{ location: 'anywhere', terms: ['fixme', 'xxx'] },
],
'prefer-destructuring': [
'error',
{
VariableDeclarator: {
AssignmentExpression: {
array: false,
object: true,
},
AssignmentExpression: {
VariableDeclarator: {
array: false,
object: true,
},
Expand All @@ -113,15 +123,61 @@ module.exports = {
enforceForRenamedProperties: false,
},
],
'sort-requires/sort-requires': 2,
'prettier/prettier': 'error',
'promise/always-return': 'off', // todo: warn
'promise/avoid-new': 'off', // todo: warn
'promise/catch-or-return': 'off', // todo: warn
'promise/no-callback-in-promise': 'warn',
'promise/no-native': 'off',
'promise/no-nesting': 'warn',
'promise/no-new-statics': 'error',
'promise/no-promise-in-callback': 'warn',
'promise/no-return-in-finally': 'warn',
'promise/no-return-wrap': 'error',
'promise/param-names': 'error',
'promise/valid-params': 'warn',
quotes: ['error', 'single', { avoidEscape: true }],
'react/jsx-sort-props': [
'error',
{
callbacksLast: true,
ignoreCase: false,
noSortAlphabetically: false,
shorthandFirst: true,
shorthandLast: false,
},
],
'react/prop-types': 'off',
'require-atomic-updates': 'off',
'security/detect-child-process': 'off',
'security/detect-non-literal-fs-filename': 'off',
'security/detect-object-injection': 'off',
'sort-destructure-keys/sort-destructure-keys': [
'error',
{ caseSensitive: false },
],
'sort-imports-es6-autofix/sort-imports-es6': [
'error',
{
ignoreCase: false,
ignoreMemberSort: false,
memberSyntaxSortOrder: ['none', 'all', 'multiple', 'single'],
},
],
'sort-keys-fix/sort-keys-fix': [
'error',
'asc',
{ caseSensitive: true, natural: true },
],
'sort-requires/sort-requires': 'error',
'spellcheck/spell-checker': [
1,
'warn',
{
comments: true,
strings: false,
identifiers: false,
templates: false,
lang: 'en_US',
minLength: 4,
skipIfMatch: ['https?://[^\\s]{10,}', '^[^\\s]{35,}$'],
skipWords: [
'anthony',
'args',
Expand Down Expand Up @@ -304,32 +360,19 @@ module.exports = {
'workitems',
'xpos',
],
skipIfMatch: ['^https?://[^\\s]*$', '^[^\\s]{35,}$'],
minLength: 4,
strings: false,
templates: false,
},
],
},
settings: {
react: {
version: '16.12.0',
},
'import/resolver': {
node: {
extensions: ['.js', '.jsx'],
},
},
react: {
version: '16.12.0',
},
},
env: {
'cypress/globals': true,
'jest/globals': true,
browser: true,
es6: true,
node: true,
},
parserOptions: {
ecmaVersion: 9,
jsx: true,
sourceType: 'module',
},
parser: 'babel-eslint',
};
29 changes: 29 additions & 0 deletions .github/workflows/nodejs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Node.js CI

on:
push:
branches: [ develop, experimental, master ]
pull_request:
branches: [ develop, experimental, master ]

jobs:
linting:
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [12.x]

steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: NPM Install
run: npm ci --no-optional && npm rebuild node-sass
- name: Lint
run: npm run lint
- name: Shellcheck
run: ./run-shellcheck.sh

4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ RUN freshclam
RUN pip install --upgrade pip
RUN apt-get install -y awscli && \
pip install --upgrade awscli==${AWS_CLI_VERSION} && \
wget -q -O terraform_0.11.13_linux_amd64.zip https://releases.hashicorp.com/terraform/0.11.13/terraform_0.11.13_linux_amd64.zip && \
unzip -o terraform_0.11.13_linux_amd64.zip terraform && \
wget -q -O terraform_0.11.14_linux_amd64.zip https://releases.hashicorp.com/terraform/0.11.14/terraform_0.11.14_linux_amd64.zip && \
unzip -o terraform_0.11.14_linux_amd64.zip terraform && \
cp terraform /usr/local/bin/ && \
curl -OL 'https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-3.2.0.1227-linux.zip' && \
mkdir sonar_scanner && \
Expand Down
1 change: 1 addition & 0 deletions config/exp2.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
nodeEnv: production
1 change: 1 addition & 0 deletions config/local.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ masterDynamodbEndpoint: http://localhost:8000
masterRegion: us-east-1
nodeEnv: development
clamavDefDir: ''
irsSuperuserEmail: irsSuperuserEmail@example.com
1 change: 1 addition & 0 deletions cypress-smoketests/plugins/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
// This function is called when a project is opened or re-opened (e.g. due to
// the project's config changing)

// eslint-disable-next-line no-unused-vars
module.exports = (on, config) => {
// `on` is used to hook into various events Cypress emits
// `config` is the resolved Cypress config
Expand Down
4 changes: 1 addition & 3 deletions cypress/integration/assign-a-work-item-to-self.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,7 @@ describe('Assign a work item ', () => {
.contains('td.to', 'Test Petitionsclerk')
.should('exist');

getWorkItemRow('101-19W')
.contains('a', 'Petition')
.click();
getWorkItemRow('101-19W').contains('a', 'Petition').click();
getWorkItemMessages();

getWorkItemMessage('2611344f-f7bf-4f47-8ba0-60c70cb25446').contains(
Expand Down
1 change: 1 addition & 0 deletions cypress/integration/edit-a-trial-session.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ describe('Edit a trial session ', () => {

getCancelButton().click();

// eslint-disable-next-line cypress/no-unnecessary-waiting
cy.wait(3000);
getCancelModalTitle().should('exist');
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,13 @@ const {
navigateTo: navigateToCaseDetail,
} = require('../support/pages/case-detail');

describe('Edit a case caption from case detail header', function() {
describe('Edit a case caption from case detail header', function () {
before(() => {
cy.task('seed');
navigateToCaseDetail('docketclerk', '101-19');
getActionMenuButton().click();
getEditCaseCaptionButton().click();
getCaptionTextArea()
.clear()
.type('there is no cow level');
getCaptionTextArea().clear().type('there is no cow level');
getSaveButton().click();
});

Expand Down
Loading

0 comments on commit 6199a3c

Please sign in to comment.