diff --git a/.github/workflows/api.yml b/.github/workflows/api.yml index 34cd0502bb4..a02613d8836 100644 --- a/.github/workflows/api.yml +++ b/.github/workflows/api.yml @@ -1,22 +1,22 @@ -name: Node.js CI - API +# name: Node.js CI - API -on: - pull_request: +# on: +# pull_request: -jobs: - API: - runs-on: ubuntu-latest +# jobs: +# API: +# runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - uses: actions/setup-node@v3 - with: - node-version: '18.15.0' - - name: Collect Workflow Telemetry - uses: runforesight/workflow-telemetry-action@v1 - with: - comment_on_pr: false - - name: Install Node Dependencies - run: npm ci - - name: API - run: npm run test:api +# steps: +# - uses: actions/checkout@v3 +# - uses: actions/setup-node@v3 +# with: +# node-version: '18.15.0' +# - name: Collect Workflow Telemetry +# uses: runforesight/workflow-telemetry-action@v1 +# with: +# comment_on_pr: false +# - name: Install Node Dependencies +# run: npm ci +# - name: API +# run: npm run test:api diff --git a/.github/workflows/backmerge-PR.yml b/.github/workflows/backmerge-PR.yml index ebe4c0f79c4..bf5c65ee63e 100644 --- a/.github/workflows/backmerge-PR.yml +++ b/.github/workflows/backmerge-PR.yml @@ -1,37 +1,37 @@ -name: Auto-create PRs to test after staging update -on: - pull_request: - branches: [staging] - types: [closed] +# name: Auto-create PRs to test after staging update +# on: +# pull_request: +# branches: [staging] +# types: [closed] -permissions: - pull-requests: write - contents: write +# permissions: +# pull-requests: write +# contents: write -jobs: - createPullRequest: - if: github.event.pull_request.merged == true - timeout-minutes: 2 - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - with: - ref: test - - name: Reset promotion branch - run: | - git fetch origin staging:staging - git reset --hard staging - - name: Create Pull Request - id: cpr - uses: peter-evans/create-pull-request@v4 - with: - delete-branch: true - title: 'Auto backmerge staging into test PR' - branch: test-promotion - branch-suffix: timestamp - body: | - Auto backmerge staging into test - - Updated with latest staging branch upon feature branch merge - - Auto-generated by [create-pull-request][1] +# jobs: +# createPullRequest: +# if: github.event.pull_request.merged == true +# timeout-minutes: 2 +# runs-on: ubuntu-latest +# steps: +# - uses: actions/checkout@v3 +# with: +# ref: test +# - name: Reset promotion branch +# run: | +# git fetch origin staging:staging +# git reset --hard staging +# - name: Create Pull Request +# id: cpr +# uses: peter-evans/create-pull-request@v4 +# with: +# delete-branch: true +# title: 'Auto backmerge staging into test PR' +# branch: test-promotion +# branch-suffix: timestamp +# body: | +# Auto backmerge staging into test +# - Updated with latest staging branch upon feature branch merge +# - Auto-generated by [create-pull-request][1] - [1]: https://github.com/peter-evans/create-pull-request \ No newline at end of file +# [1]: https://github.com/peter-evans/create-pull-request diff --git a/.github/workflows/build-ts-api.yml b/.github/workflows/build-ts-api.yml index 5f4c737b801..064a24766d6 100644 --- a/.github/workflows/build-ts-api.yml +++ b/.github/workflows/build-ts-api.yml @@ -1,24 +1,24 @@ -name: Build API Typescript +# name: Build API Typescript -on: - pull_request: +# on: +# pull_request: -jobs: - build_ts_api: - runs-on: ubuntu-latest +# jobs: +# build_ts_api: +# runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - uses: actions/setup-node@v3 - with: - node-version: '18.15.0' - - name: Collect Workflow Telemetry - uses: runforesight/workflow-telemetry-action@v1 - with: - comment_on_pr: false - - name: Install Node Dependencies - run: npm ci - - name: Build Typescript API - run: | - npm run build:assets - npm run build:lambda:api +# steps: +# - uses: actions/checkout@v3 +# - uses: actions/setup-node@v3 +# with: +# node-version: '18.15.0' +# - name: Collect Workflow Telemetry +# uses: runforesight/workflow-telemetry-action@v1 +# with: +# comment_on_pr: false +# - name: Install Node Dependencies +# run: npm ci +# - name: Build Typescript API +# run: | +# npm run build:assets +# npm run build:lambda:api diff --git a/.github/workflows/client-integration-public.yml b/.github/workflows/client-integration-public.yml index 6ac57de60fd..19886a548f9 100644 --- a/.github/workflows/client-integration-public.yml +++ b/.github/workflows/client-integration-public.yml @@ -1,56 +1,56 @@ -name: Node.js Client Integration Tests +# name: Node.js Client Integration Tests -on: - pull_request: +# on: +# pull_request: -jobs: - client_integration_public: - runs-on: ubuntu-latest +# jobs: +# client_integration_public: +# runs-on: ubuntu-latest - strategy: - fail-fast: false - matrix: - ci_node_total: [2] - ci_node_index: [0, 1] - env: - CI_NODE_TOTAL: ${{ matrix.ci_node_total }} - CI_NODE_INDEX: ${{ matrix.ci_node_index }} - steps: - - uses: actions/checkout@v3 - - uses: actions/setup-node@v3 - with: - node-version: '18.15.0' - - name: Configure sysctl limits - run: | - sudo swapoff -a - sudo sysctl -w vm.swappiness=1 - sudo sysctl -w fs.file-max=262144 - sudo sysctl -w vm.max_map_count=262144 - - name: Runs Elasticsearch - uses: elastic/elastic-github-actions/elasticsearch@master - with: - stack-version: 7.10.2 - security-enabled: false - - name: Setup DynamoDB Local - uses: rrainn/dynamodb-action@v3.0.0 - with: - port: 8000 - cors: '*' - - name: Collect Workflow Telemetry - uses: runforesight/workflow-telemetry-action@v1 - with: - comment_on_pr: false - - name: Install Node Dependencies - run: npm ci - - name: Web Client - Integration Tests Public - run: | - mkdir -p /tmp/web-client - npm run start:api:ci > /tmp/web-client/server-output${{ matrix.ci_node_index }}.txt & - ./wait-until-services.sh - export TESTFILES=$(npx ts-node split-tests.ts -public) - npm run test:client:integration:ci - - name: Store Artifacts - uses: actions/upload-artifact@v3 - with: - name: server log output - path: /tmp/web-client/server-output${{ matrix.ci_node_index }}.txt +# strategy: +# fail-fast: false +# matrix: +# ci_node_total: [2] +# ci_node_index: [0, 1] +# env: +# CI_NODE_TOTAL: ${{ matrix.ci_node_total }} +# CI_NODE_INDEX: ${{ matrix.ci_node_index }} +# steps: +# - uses: actions/checkout@v3 +# - uses: actions/setup-node@v3 +# with: +# node-version: '18.15.0' +# - name: Configure sysctl limits +# run: | +# sudo swapoff -a +# sudo sysctl -w vm.swappiness=1 +# sudo sysctl -w fs.file-max=262144 +# sudo sysctl -w vm.max_map_count=262144 +# - name: Runs Elasticsearch +# uses: elastic/elastic-github-actions/elasticsearch@master +# with: +# stack-version: 7.10.2 +# security-enabled: false +# - name: Setup DynamoDB Local +# uses: rrainn/dynamodb-action@v3.0.0 +# with: +# port: 8000 +# cors: '*' +# - name: Collect Workflow Telemetry +# uses: runforesight/workflow-telemetry-action@v1 +# with: +# comment_on_pr: false +# - name: Install Node Dependencies +# run: npm ci +# - name: Web Client - Integration Tests Public +# run: | +# mkdir -p /tmp/web-client +# npm run start:api:ci > /tmp/web-client/server-output${{ matrix.ci_node_index }}.txt & +# ./wait-until-services.sh +# export TESTFILES=$(npx ts-node split-tests.ts -public) +# npm run test:client:integration:ci +# - name: Store Artifacts +# uses: actions/upload-artifact@v3 +# with: +# name: server log output +# path: /tmp/web-client/server-output${{ matrix.ci_node_index }}.txt diff --git a/.github/workflows/client-integration.yml b/.github/workflows/client-integration.yml index 9deec84c728..80ab7f48c3d 100644 --- a/.github/workflows/client-integration.yml +++ b/.github/workflows/client-integration.yml @@ -12,6 +12,7 @@ jobs: matrix: ci_node_total: [12] ci_node_index: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11] + env: CI_NODE_TOTAL: ${{ matrix.ci_node_total }} CI_NODE_INDEX: ${{ matrix.ci_node_index }} diff --git a/.github/workflows/client.yml b/.github/workflows/client.yml index 277f1e4405c..991392e1787 100644 --- a/.github/workflows/client.yml +++ b/.github/workflows/client.yml @@ -1,55 +1,55 @@ -name: Node.js CI - Client Unit Tests +# name: Node.js CI - Client Unit Tests -on: - pull_request: +# on: +# pull_request: -jobs: - Client: - runs-on: ubuntu-latest - strategy: - fail-fast: false - matrix: - ci_node_total: [4] - ci_node_index: [0, 1, 2, 3] - env: - CI_NODE_TOTAL: ${{ matrix.ci_node_total }} - CI_NODE_INDEX: ${{ matrix.ci_node_index }} - steps: - - uses: actions/checkout@v3 - - uses: actions/setup-node@v3 - with: - node-version: '18.15.0' - - name: Collect Workflow Telemetry - uses: runforesight/workflow-telemetry-action@v1 - with: - comment_on_pr: false - - name: Install Node Dependencies - run: npm ci - - name: Test Client Unit - run: | - export TESTFILES=$(npx ts-node split-tests-glob.ts -unit) - NODE_INDEX=${{ matrix.ci_node_index }} npm run test:client:unit:ci - - name: Rename coverage to shard coverage - run: | - mkdir -p coverage - cp web-client/coverage/${{ matrix.ci_node_index }}/lcov.info coverage/lcov-${{ matrix.ci_node_index }}.info - cp web-client/coverage/${{ matrix.ci_node_index }}/coverage-final.json coverage/coverage-${{ matrix.ci_node_index }}.json - - uses: actions/upload-artifact@v3 - with: - name: coverage-artifacts - path: coverage - check-coverage: - runs-on: ubuntu-latest - needs: [Client] - steps: - - uses: actions/checkout@v3 - - uses: actions/download-artifact@v3 - with: - name: coverage-artifacts - path: coverage - - name: Process Coverage - run: npx nyc report --check-coverage --branches 94.56 --functions 98.81 --lines 99.25 --statements 99.23 --reporter lcov --reporter text --reporter clover -t coverage - - uses: geekyeggo/delete-artifact@v1 - with: - name: coverage-artifacts - failOnError: false +# jobs: +# Client: +# runs-on: ubuntu-latest +# strategy: +# fail-fast: false +# matrix: +# ci_node_total: [4] +# ci_node_index: [0, 1, 2, 3] +# env: +# CI_NODE_TOTAL: ${{ matrix.ci_node_total }} +# CI_NODE_INDEX: ${{ matrix.ci_node_index }} +# steps: +# - uses: actions/checkout@v3 +# - uses: actions/setup-node@v3 +# with: +# node-version: '18.15.0' +# - name: Collect Workflow Telemetry +# uses: runforesight/workflow-telemetry-action@v1 +# with: +# comment_on_pr: false +# - name: Install Node Dependencies +# run: npm ci +# - name: Test Client Unit +# run: | +# export TESTFILES=$(npx ts-node split-tests-glob.ts -unit) +# NODE_INDEX=${{ matrix.ci_node_index }} npm run test:client:unit:ci +# - name: Rename coverage to shard coverage +# run: | +# mkdir -p coverage +# cp web-client/coverage/${{ matrix.ci_node_index }}/lcov.info coverage/lcov-${{ matrix.ci_node_index }}.info +# cp web-client/coverage/${{ matrix.ci_node_index }}/coverage-final.json coverage/coverage-${{ matrix.ci_node_index }}.json +# - uses: actions/upload-artifact@v3 +# with: +# name: coverage-artifacts +# path: coverage +# check-coverage: +# runs-on: ubuntu-latest +# needs: [Client] +# steps: +# - uses: actions/checkout@v3 +# - uses: actions/download-artifact@v3 +# with: +# name: coverage-artifacts +# path: coverage +# - name: Process Coverage +# run: npx nyc report --check-coverage --branches 94.56 --functions 98.81 --lines 99.25 --statements 99.23 --reporter lcov --reporter text --reporter clover -t coverage +# - uses: geekyeggo/delete-artifact@v1 +# with: +# name: coverage-artifacts +# failOnError: false diff --git a/.github/workflows/e2e-cypress-public.yml b/.github/workflows/e2e-cypress-public.yml index 85980eb26a6..bd646d301d7 100644 --- a/.github/workflows/e2e-cypress-public.yml +++ b/.github/workflows/e2e-cypress-public.yml @@ -1,40 +1,40 @@ -name: E2E Cypress Public +# name: E2E Cypress Public -on: - pull_request: +# on: +# pull_request: -jobs: - e2e_cypress_public: - runs-on: ubuntu-latest +# jobs: +# e2e_cypress_public: +# runs-on: ubuntu-latest - env: - CI: true - CHECK_DEPLOY_DATE_INTERVAL: 5000 - steps: - - uses: actions/checkout@v3 - - uses: actions/setup-node@v3 - with: - node-version: '18.15.0' - - name: Runs Elasticsearch - uses: elastic/elastic-github-actions/elasticsearch@master - with: - stack-version: 7.10.2 - security-enabled: false - - name: Setup DynamoDB Local - uses: rrainn/dynamodb-action@v3.0.0 - with: - port: 8000 - cors: '*' - - name: Collect Workflow Telemetry - uses: runforesight/workflow-telemetry-action@v1 - with: - comment_on_pr: false - - name: Install Node Dependencies - run: npm ci - - name: Run E2E Cypress - run: | - mkdir -p /tmp/cypress/ - npm run start:all:ci >> /tmp/cypress/cypress-output.txt & - ./wait-until-services.sh - sleep 5 - npm run cypress:integration:public +# env: +# CI: true +# CHECK_DEPLOY_DATE_INTERVAL: 5000 +# steps: +# - uses: actions/checkout@v3 +# - uses: actions/setup-node@v3 +# with: +# node-version: '18.15.0' +# - name: Runs Elasticsearch +# uses: elastic/elastic-github-actions/elasticsearch@master +# with: +# stack-version: 7.10.2 +# security-enabled: false +# - name: Setup DynamoDB Local +# uses: rrainn/dynamodb-action@v3.0.0 +# with: +# port: 8000 +# cors: '*' +# - name: Collect Workflow Telemetry +# uses: runforesight/workflow-telemetry-action@v1 +# with: +# comment_on_pr: false +# - name: Install Node Dependencies +# run: npm ci +# - name: Run E2E Cypress +# run: | +# mkdir -p /tmp/cypress/ +# npm run start:all:ci >> /tmp/cypress/cypress-output.txt & +# ./wait-until-services.sh +# sleep 5 +# npm run cypress:integration:public diff --git a/.github/workflows/e2e-cypress-smoketests-local.yml b/.github/workflows/e2e-cypress-smoketests-local.yml index 8c9eba3c38c..ecaa76ef11d 100644 --- a/.github/workflows/e2e-cypress-smoketests-local.yml +++ b/.github/workflows/e2e-cypress-smoketests-local.yml @@ -1,55 +1,55 @@ -name: E2E Cypress Smoketests Local +# name: E2E Cypress Smoketests Local -on: - pull_request: +# on: +# pull_request: -jobs: - e2e_cypress_smoketests_local: - runs-on: ubuntu-latest +# jobs: +# e2e_cypress_smoketests_local: +# runs-on: ubuntu-latest - env: - CI: true - steps: - - uses: actions/checkout@v3 - - uses: actions/setup-node@v3 - with: - node-version: '18.15.0' - - name: Configure sysctl limits - run: | - sudo swapoff -a - sudo sysctl -w vm.swappiness=1 - sudo sysctl -w fs.file-max=262144 - sudo sysctl -w vm.max_map_count=262144 - - name: Runs Elasticsearch - uses: elastic/elastic-github-actions/elasticsearch@master - with: - stack-version: 7.10.2 - security-enabled: false - - name: Setup DynamoDB Local - uses: rrainn/dynamodb-action@v3.0.0 - with: - port: 8000 - cors: '*' - - name: Collect Workflow Telemetry - uses: runforesight/workflow-telemetry-action@v1 - with: - comment_on_pr: false - - name: Install Node Dependencies - run: npm ci - - name: Run E2E Cypress Smoketests - run: | - mkdir -p /tmp/cypress/ - npm run start:all:ci >> /tmp/cypress/cypress-output.txt & - ./wait-until-services.sh - sleep 5 - npm run cypress:smoketests:local - - name: Store Video Artifacts - uses: actions/upload-artifact@v3 - with: - name: cypress-videos - path: ${{ github.workspace }}/cypress/cypress-smoketests/videos - - name: Store Logs - uses: actions/upload-artifact@v3 - with: - name: cypress-logs - path: /tmp/cypress +# env: +# CI: true +# steps: +# - uses: actions/checkout@v3 +# - uses: actions/setup-node@v3 +# with: +# node-version: '18.15.0' +# - name: Configure sysctl limits +# run: | +# sudo swapoff -a +# sudo sysctl -w vm.swappiness=1 +# sudo sysctl -w fs.file-max=262144 +# sudo sysctl -w vm.max_map_count=262144 +# - name: Runs Elasticsearch +# uses: elastic/elastic-github-actions/elasticsearch@master +# with: +# stack-version: 7.10.2 +# security-enabled: false +# - name: Setup DynamoDB Local +# uses: rrainn/dynamodb-action@v3.0.0 +# with: +# port: 8000 +# cors: '*' +# - name: Collect Workflow Telemetry +# uses: runforesight/workflow-telemetry-action@v1 +# with: +# comment_on_pr: false +# - name: Install Node Dependencies +# run: npm ci +# - name: Run E2E Cypress Smoketests +# run: | +# mkdir -p /tmp/cypress/ +# npm run start:all:ci >> /tmp/cypress/cypress-output.txt & +# ./wait-until-services.sh +# sleep 5 +# npm run cypress:smoketests:local +# - name: Store Video Artifacts +# uses: actions/upload-artifact@v3 +# with: +# name: cypress-videos +# path: ${{ github.workspace }}/cypress/cypress-smoketests/videos +# - name: Store Logs +# uses: actions/upload-artifact@v3 +# with: +# name: cypress-logs +# path: /tmp/cypress diff --git a/.github/workflows/e2e-cypress.yml b/.github/workflows/e2e-cypress.yml index 82276d5ac37..d6a21acfd28 100644 --- a/.github/workflows/e2e-cypress.yml +++ b/.github/workflows/e2e-cypress.yml @@ -1,44 +1,44 @@ -name: E2E Cypress +# name: E2E Cypress -on: - pull_request: +# on: +# pull_request: -jobs: - e2e_cypress: - runs-on: ubuntu-latest +# jobs: +# e2e_cypress: +# runs-on: ubuntu-latest - env: - CI: true - steps: - - uses: actions/checkout@v3 - - uses: actions/setup-node@v3 - with: - node-version: '18.15.0' - - name: Runs Elasticsearch - uses: elastic/elastic-github-actions/elasticsearch@master - with: - stack-version: 7.10.2 - security-enabled: false - - name: Setup DynamoDB Local - uses: rrainn/dynamodb-action@v3.0.0 - with: - port: 8000 - cors: '*' - - name: Collect Workflow Telemetry - uses: runforesight/workflow-telemetry-action@v1 - with: - comment_on_pr: false - - name: Install Node Dependencies - run: npm ci - - name: Run E2E Cypress - run: | - mkdir -p /tmp/cypress/ - npm run start:all:ci >> /tmp/cypress/cypress-output.txt & - ./wait-until-services.sh - sleep 5 - npm run cypress:integration - - name: Store Logs - uses: actions/upload-artifact@v3 - with: - name: cypress-logs - path: /tmp/cypress +# env: +# CI: true +# steps: +# - uses: actions/checkout@v3 +# - uses: actions/setup-node@v3 +# with: +# node-version: '18.15.0' +# - name: Runs Elasticsearch +# uses: elastic/elastic-github-actions/elasticsearch@master +# with: +# stack-version: 7.10.2 +# security-enabled: false +# - name: Setup DynamoDB Local +# uses: rrainn/dynamodb-action@v3.0.0 +# with: +# port: 8000 +# cors: '*' +# - name: Collect Workflow Telemetry +# uses: runforesight/workflow-telemetry-action@v1 +# with: +# comment_on_pr: false +# - name: Install Node Dependencies +# run: npm ci +# - name: Run E2E Cypress +# run: | +# mkdir -p /tmp/cypress/ +# npm run start:all:ci >> /tmp/cypress/cypress-output.txt & +# ./wait-until-services.sh +# sleep 5 +# npm run cypress:integration +# - name: Store Logs +# uses: actions/upload-artifact@v3 +# with: +# name: cypress-logs +# path: /tmp/cypress diff --git a/.github/workflows/e2e-pa11y-public.yml b/.github/workflows/e2e-pa11y-public.yml index 834ebe7674b..3179680df82 100644 --- a/.github/workflows/e2e-pa11y-public.yml +++ b/.github/workflows/e2e-pa11y-public.yml @@ -1,59 +1,59 @@ -name: E2E Pa11y Public (Search) +# name: E2E Pa11y Public (Search) -on: - pull_request: +# on: +# pull_request: -jobs: - e2e_pa11y_public: - runs-on: ubuntu-latest +# jobs: +# e2e_pa11y_public: +# runs-on: ubuntu-latest - env: - CI: true - steps: - - uses: actions/checkout@v3 - - uses: actions/setup-node@v3 - with: - node-version: '18.15.0' - - name: Configure sysctl limits - run: | - sudo swapoff -a - sudo sysctl -w vm.swappiness=1 - sudo sysctl -w fs.file-max=262144 - sudo sysctl -w vm.max_map_count=262144 - - name: Runs Elasticsearch - uses: elastic/elastic-github-actions/elasticsearch@master - with: - stack-version: 7.10.2 - security-enabled: false - - name: Setup DynamoDB Local - uses: rrainn/dynamodb-action@v3.0.0 - with: - port: 8000 - cors: '*' - - name: Collect Workflow Telemetry - uses: runforesight/workflow-telemetry-action@v1 - with: - comment_on_pr: false - - name: Install Node Dependencies - run: npm ci - - name: Start API and Client - run: | - mkdir -p /tmp/pa11y/ - npm run start:all:ci >> /tmp/pa11y/pa11y-server.txt & - ./wait-until-services.sh - URL=http://localhost:5000/public-api/health ./wait-until.sh - sleep 10 - - name: Run E2E Pa11y Public - run: npm run test:pa11y:public --node-flags --max-old-space-size=1536 - - name: Run E2E Pa11y Public Search - run: npm run test:pa11y:public-search --node-flags --max-old-space-size=1536 - - name: Store Screenshots Artifacts - uses: actions/upload-artifact@v3 - with: - name: screen-shots - path: ${{ github.workspace }}/web-client/pa11y/pa11y-screenshots - - name: Store Server Logs - uses: actions/upload-artifact@v3 - with: - name: server-logs - path: /tmp/pa11y +# env: +# CI: true +# steps: +# - uses: actions/checkout@v3 +# - uses: actions/setup-node@v3 +# with: +# node-version: '18.15.0' +# - name: Configure sysctl limits +# run: | +# sudo swapoff -a +# sudo sysctl -w vm.swappiness=1 +# sudo sysctl -w fs.file-max=262144 +# sudo sysctl -w vm.max_map_count=262144 +# - name: Runs Elasticsearch +# uses: elastic/elastic-github-actions/elasticsearch@master +# with: +# stack-version: 7.10.2 +# security-enabled: false +# - name: Setup DynamoDB Local +# uses: rrainn/dynamodb-action@v3.0.0 +# with: +# port: 8000 +# cors: '*' +# - name: Collect Workflow Telemetry +# uses: runforesight/workflow-telemetry-action@v1 +# with: +# comment_on_pr: false +# - name: Install Node Dependencies +# run: npm ci +# - name: Start API and Client +# run: | +# mkdir -p /tmp/pa11y/ +# npm run start:all:ci >> /tmp/pa11y/pa11y-server.txt & +# ./wait-until-services.sh +# URL=http://localhost:5000/public-api/health ./wait-until.sh +# sleep 10 +# - name: Run E2E Pa11y Public +# run: npm run test:pa11y:public --node-flags --max-old-space-size=1536 +# - name: Run E2E Pa11y Public Search +# run: npm run test:pa11y:public-search --node-flags --max-old-space-size=1536 +# - name: Store Screenshots Artifacts +# uses: actions/upload-artifact@v3 +# with: +# name: screen-shots +# path: ${{ github.workspace }}/web-client/pa11y/pa11y-screenshots +# - name: Store Server Logs +# uses: actions/upload-artifact@v3 +# with: +# name: server-logs +# path: /tmp/pa11y diff --git a/.github/workflows/e2e-pa11y.yml b/.github/workflows/e2e-pa11y.yml index 79844276cdb..e3e4536c964 100644 --- a/.github/workflows/e2e-pa11y.yml +++ b/.github/workflows/e2e-pa11y.yml @@ -1,62 +1,62 @@ -name: E2E Pa11y +# name: E2E Pa11y -on: - pull_request: +# on: +# pull_request: -jobs: - e2e_pa11y: - runs-on: ubuntu-latest +# jobs: +# e2e_pa11y: +# runs-on: ubuntu-latest - env: - CI: true - steps: - - uses: actions/checkout@v3 - - uses: actions/setup-node@v3 - with: - node-version: '18.15.0' - - name: Configure sysctl limits - run: | - sudo swapoff -a - sudo sysctl -w vm.swappiness=1 - sudo sysctl -w fs.file-max=262144 - sudo sysctl -w vm.max_map_count=262144 - - name: Runs Elasticsearch - uses: elastic/elastic-github-actions/elasticsearch@master - with: - stack-version: 7.10.2 - security-enabled: false - - name: Setup DynamoDB Local - uses: rrainn/dynamodb-action@v3.0.0 - with: - port: 8000 - cors: '*' - - name: Collect Workflow Telemetry - uses: runforesight/workflow-telemetry-action@v1 - with: - comment_on_pr: false - - name: Install Node Dependencies - run: npm ci - - name: Start API and Client - run: | - mkdir -p /tmp/pa11y/ - npm run start:all:ci >> /tmp/pa11y/pa11y-server.txt & - URL=http://localhost:1234 ./wait-until.sh - sleep 20 - - name: Run E2E Pa11y 1 - run: npm run test:pa11y:1 --node-flags --max-old-space-size=1024 - - name: Run E2E Pa11y 2 - run: npm run test:pa11y:2 --node-flags --max-old-space-size=1024 - - name: Run E2E Pa11y 3 - run: npm run test:pa11y:3 --node-flags --max-old-space-size=1024 - - name: Run E2E Pa11y 4 - run: npm run test:pa11y:4 --node-flags --max-old-space-size=1024 - - name: Store Screenshots Artifacts - uses: actions/upload-artifact@v3 - with: - name: screen-shots - path: ${{ github.workspace }}/web-client/pa11y/pa11y-screenshots - - name: Store Server Logs - uses: actions/upload-artifact@v3 - with: - name: server-logs - path: /tmp/pa11y +# env: +# CI: true +# steps: +# - uses: actions/checkout@v3 +# - uses: actions/setup-node@v3 +# with: +# node-version: '18.15.0' +# - name: Configure sysctl limits +# run: | +# sudo swapoff -a +# sudo sysctl -w vm.swappiness=1 +# sudo sysctl -w fs.file-max=262144 +# sudo sysctl -w vm.max_map_count=262144 +# - name: Runs Elasticsearch +# uses: elastic/elastic-github-actions/elasticsearch@master +# with: +# stack-version: 7.10.2 +# security-enabled: false +# - name: Setup DynamoDB Local +# uses: rrainn/dynamodb-action@v3.0.0 +# with: +# port: 8000 +# cors: '*' +# - name: Collect Workflow Telemetry +# uses: runforesight/workflow-telemetry-action@v1 +# with: +# comment_on_pr: false +# - name: Install Node Dependencies +# run: npm ci +# - name: Start API and Client +# run: | +# mkdir -p /tmp/pa11y/ +# npm run start:all:ci >> /tmp/pa11y/pa11y-server.txt & +# URL=http://localhost:1234 ./wait-until.sh +# sleep 20 +# - name: Run E2E Pa11y 1 +# run: npm run test:pa11y:1 --node-flags --max-old-space-size=1024 +# - name: Run E2E Pa11y 2 +# run: npm run test:pa11y:2 --node-flags --max-old-space-size=1024 +# - name: Run E2E Pa11y 3 +# run: npm run test:pa11y:3 --node-flags --max-old-space-size=1024 +# - name: Run E2E Pa11y 4 +# run: npm run test:pa11y:4 --node-flags --max-old-space-size=1024 +# - name: Store Screenshots Artifacts +# uses: actions/upload-artifact@v3 +# with: +# name: screen-shots +# path: ${{ github.workspace }}/web-client/pa11y/pa11y-screenshots +# - name: Store Server Logs +# uses: actions/upload-artifact@v3 +# with: +# name: server-logs +# path: /tmp/pa11y diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 10b68e42cdb..651669f5e21 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -1,24 +1,24 @@ -name: Node.js CI - Lint +# name: Node.js CI - Lint -on: - pull_request: +# on: +# pull_request: -jobs: - Lint: - runs-on: ubuntu-latest +# jobs: +# Lint: +# runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - uses: actions/setup-node@v3 - with: - node-version: '18.15.0' - - name: Collect Workflow Telemetry - uses: runforesight/workflow-telemetry-action@v1 - with: - comment_on_pr: false - - name: Install Node Dependencies - run: npm ci - - name: Lint - run: npm run lint - - name: Shellcheck - run: ./run-shellcheck.sh +# steps: +# - uses: actions/checkout@v3 +# - uses: actions/setup-node@v3 +# with: +# node-version: '18.15.0' +# - name: Collect Workflow Telemetry +# uses: runforesight/workflow-telemetry-action@v1 +# with: +# comment_on_pr: false +# - name: Install Node Dependencies +# run: npm ci +# - name: Lint +# run: npm run lint +# - name: Shellcheck +# run: ./run-shellcheck.sh diff --git a/.github/workflows/pdfs.yml b/.github/workflows/pdfs.yml index 7ae798a0d20..911db0e6e44 100644 --- a/.github/workflows/pdfs.yml +++ b/.github/workflows/pdfs.yml @@ -1,26 +1,26 @@ -name: Verify PDFS +# name: Verify PDFS -on: - pull_request: +# on: +# pull_request: -jobs: - test_pdfs: - runs-on: ubuntu-latest +# jobs: +# test_pdfs: +# runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - uses: actions/setup-node@v3 - with: - node-version: '18.15.0' - - name: Collect Workflow Telemetry - uses: runforesight/workflow-telemetry-action@v1 - with: - comment_on_pr: false - - name: Setup - run: | - sudo apt-get update - sudo apt-get install -o Acquire::Retries=3 -y graphicsmagick ghostscript - - name: Install Node Dependencies - run: npm ci && npm rebuild - - name: Generate and Test PDFs - run: npm run test:document-generation +# steps: +# - uses: actions/checkout@v3 +# - uses: actions/setup-node@v3 +# with: +# node-version: '18.15.0' +# - name: Collect Workflow Telemetry +# uses: runforesight/workflow-telemetry-action@v1 +# with: +# comment_on_pr: false +# - name: Setup +# run: | +# sudo apt-get update +# sudo apt-get install -o Acquire::Retries=3 -y graphicsmagick ghostscript +# - name: Install Node Dependencies +# run: npm ci && npm rebuild +# - name: Generate and Test PDFs +# run: npm run test:document-generation diff --git a/.github/workflows/scripts.yml b/.github/workflows/scripts.yml index 40c9e306352..cc38406890d 100644 --- a/.github/workflows/scripts.yml +++ b/.github/workflows/scripts.yml @@ -1,22 +1,22 @@ -name: Node.js CI - Scripts +# name: Node.js CI - Scripts -on: - pull_request: +# on: +# pull_request: -jobs: - Scripts: - runs-on: ubuntu-latest +# jobs: +# Scripts: +# runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - uses: actions/setup-node@v3 - with: - node-version: '18.15.0' - - name: Collect WorkQflow Telemetry - uses: runforesight/workflow-telemetry-action@v1 - with: - comment_on_pr: false - - name: Install Node Dependencies - run: npm ci - - name: Scripts - run: npm run test:scripts +# steps: +# - uses: actions/checkout@v3 +# - uses: actions/setup-node@v3 +# with: +# node-version: '18.15.0' +# - name: Collect WorkQflow Telemetry +# uses: runforesight/workflow-telemetry-action@v1 +# with: +# comment_on_pr: false +# - name: Install Node Dependencies +# run: npm ci +# - name: Scripts +# run: npm run test:scripts diff --git a/.github/workflows/shared.yml b/.github/workflows/shared.yml index 5eb8f4d5463..7c304d7fe1e 100644 --- a/.github/workflows/shared.yml +++ b/.github/workflows/shared.yml @@ -1,55 +1,55 @@ -name: Node.js CI - Shared +# name: Node.js CI - Shared -on: - pull_request: +# on: +# pull_request: -jobs: - Shared: - runs-on: ubuntu-latest - strategy: - fail-fast: false - matrix: - ci_node_total: [4] - ci_node_index: [0, 1, 2, 3] - env: - CI_NODE_TOTAL: ${{ matrix.ci_node_total }} - CI_NODE_INDEX: ${{ matrix.ci_node_index }} - steps: - - uses: actions/checkout@v3 - - uses: actions/setup-node@v3 - with: - node-version: '18.15.0' - - name: Collect Workflow Telemetry - uses: runforesight/workflow-telemetry-action@v1 - with: - comment_on_pr: false - - name: Install Node Dependencies - run: npm ci - - name: Shared - run: | - export TESTFILES=$(npx ts-node split-tests-glob.ts -shared) - NODE_INDEX=${{ matrix.ci_node_index }} npm run test:shared:ci - - name: Rename coverage to shard coverage - run: | - mkdir -p coverage - cp shared/coverage/${{ matrix.ci_node_index }}/lcov.info coverage/lcov-${{ matrix.ci_node_index }}.info - cp shared/coverage/${{ matrix.ci_node_index }}/coverage-final.json coverage/coverage-${{ matrix.ci_node_index }}.json - - uses: actions/upload-artifact@v3 - with: - name: coverage-artifacts - path: coverage - check-coverage: - runs-on: ubuntu-latest - needs: [Shared] - steps: - - uses: actions/checkout@v3 - - uses: actions/download-artifact@v3 - with: - name: coverage-artifacts - path: coverage - - name: Process Coverage - run: npx nyc report --check-coverage --branches 96.13 --functions 96.16 --lines 98.34 --statements 98.25 --reporter lcov --reporter text --reporter clover -t coverage - - uses: geekyeggo/delete-artifact@v1 - with: - name: coverage-artifacts - failOnError: false +# jobs: +# Shared: +# runs-on: ubuntu-latest +# strategy: +# fail-fast: false +# matrix: +# ci_node_total: [4] +# ci_node_index: [0, 1, 2, 3] +# env: +# CI_NODE_TOTAL: ${{ matrix.ci_node_total }} +# CI_NODE_INDEX: ${{ matrix.ci_node_index }} +# steps: +# - uses: actions/checkout@v3 +# - uses: actions/setup-node@v3 +# with: +# node-version: '18.15.0' +# - name: Collect Workflow Telemetry +# uses: runforesight/workflow-telemetry-action@v1 +# with: +# comment_on_pr: false +# - name: Install Node Dependencies +# run: npm ci +# - name: Shared +# run: | +# export TESTFILES=$(npx ts-node split-tests-glob.ts -shared) +# NODE_INDEX=${{ matrix.ci_node_index }} npm run test:shared:ci +# - name: Rename coverage to shard coverage +# run: | +# mkdir -p coverage +# cp shared/coverage/${{ matrix.ci_node_index }}/lcov.info coverage/lcov-${{ matrix.ci_node_index }}.info +# cp shared/coverage/${{ matrix.ci_node_index }}/coverage-final.json coverage/coverage-${{ matrix.ci_node_index }}.json +# - uses: actions/upload-artifact@v3 +# with: +# name: coverage-artifacts +# path: coverage +# check-coverage: +# runs-on: ubuntu-latest +# needs: [Shared] +# steps: +# - uses: actions/checkout@v3 +# - uses: actions/download-artifact@v3 +# with: +# name: coverage-artifacts +# path: coverage +# - name: Process Coverage +# run: npx nyc report --check-coverage --branches 96.13 --functions 96.16 --lines 98.34 --statements 98.25 --reporter lcov --reporter text --reporter clover -t coverage +# - uses: geekyeggo/delete-artifact@v1 +# with: +# name: coverage-artifacts +# failOnError: false diff --git a/.github/workflows/typescript-error-check.yml b/.github/workflows/typescript-error-check.yml index b7a36d7d2a3..fa71118dbfd 100644 --- a/.github/workflows/typescript-error-check.yml +++ b/.github/workflows/typescript-error-check.yml @@ -1,35 +1,35 @@ -name: Typescript Reduce Type Errors +# name: Typescript Reduce Type Errors -on: - pull_request: - push: - branches: - - dependency-updates +# on: +# pull_request: +# push: +# branches: +# - dependency-updates -jobs: - ReduceTypeErrors: - runs-on: ubuntu-latest +# jobs: +# ReduceTypeErrors: +# runs-on: ubuntu-latest - steps: - - name: Checkout USTC Staging - uses: actions/checkout@v3 - with: - repository: ustaxcourt/ef-cms - ref: staging - path: stagingBranch - - name: Checkout current branch - uses: actions/checkout@v3 - with: - path: branchToBeCompared - - uses: actions/setup-node@v3 - with: - node-version: '18.15.0' - - name: NPM Install in your branch - working-directory: ./branchToBeCompared - run: npm ci - - name: NPM Install in staging - working-directory: ./stagingBranch - run: npm ci - - name: Compare errors between your branch and staging - working-directory: ./branchToBeCompared - run: npx ts-node scripts/compareTypescriptErrors.ts +# steps: +# - name: Checkout USTC Staging +# uses: actions/checkout@v3 +# with: +# repository: ustaxcourt/ef-cms +# ref: staging +# path: stagingBranch +# - name: Checkout current branch +# uses: actions/checkout@v3 +# with: +# path: branchToBeCompared +# - uses: actions/setup-node@v3 +# with: +# node-version: '18.15.0' +# - name: NPM Install in your branch +# working-directory: ./branchToBeCompared +# run: npm ci +# - name: NPM Install in staging +# working-directory: ./stagingBranch +# run: npm ci +# - name: Compare errors between your branch and staging +# working-directory: ./branchToBeCompared +# run: npx ts-node scripts/compareTypescriptErrors.ts diff --git a/web-client/integration-tests/journey/docketClerkCreatesATrialSession.ts b/web-client/integration-tests/journey/docketClerkCreatesATrialSession.ts index 8c7f7e8761a..641b87dcef7 100644 --- a/web-client/integration-tests/journey/docketClerkCreatesATrialSession.ts +++ b/web-client/integration-tests/journey/docketClerkCreatesATrialSession.ts @@ -188,6 +188,14 @@ export const docketClerkCreatesATrialSession = ( ); expect(lastCreatedTrialSessionId).toBeDefined(); + await cerebralTest.runSequence('gotoTrialSessionDetailSequence', { + trialSessionId: cerebralTest.lastCreatedTrialSessionId, + }); + console.log( + 'trialSession!! JUST AFTER CREATING TRIAL SESSION', + cerebralTest.getState('trialSession'), + ); + cerebralTest.lastCreatedTrialSessionId = lastCreatedTrialSessionId; cerebralTest.trialSessionId = cerebralTest.lastCreatedTrialSessionId; }); diff --git a/web-client/integration-tests/journey/docketClerkViewsTrialSessionList.ts b/web-client/integration-tests/journey/docketClerkViewsTrialSessionList.ts index 8c480767d8d..7e8eca253bb 100644 --- a/web-client/integration-tests/journey/docketClerkViewsTrialSessionList.ts +++ b/web-client/integration-tests/journey/docketClerkViewsTrialSessionList.ts @@ -18,11 +18,18 @@ export const docketClerkViewsTrialSessionList = ( const formatted = runCompute(formattedTrialSessions, { state: cerebralTest.getState(), }); + + console.log('formatted SESSIONS', formatted.formattedSessions); expect(formatted.formattedSessions.length).toBeGreaterThan(0); + console.log( + 'lastCreatedTrialSessionId', + cerebralTest.lastCreatedTrialSessionId, + ); const trialSession = find(formatted.sessionsByTerm, { trialSessionId: cerebralTest.lastCreatedTrialSessionId, }); + console.log('trialSession', trialSession); expect(trialSession).toBeDefined(); diff --git a/web-client/integration-tests/journey/viewJudgeActivityReportResults.ts b/web-client/integration-tests/journey/viewJudgeActivityReportResults.ts index 9eb54c99a62..b0e69031793 100644 --- a/web-client/integration-tests/journey/viewJudgeActivityReportResults.ts +++ b/web-client/integration-tests/journey/viewJudgeActivityReportResults.ts @@ -36,19 +36,25 @@ export const viewJudgeActivityReportResults = ( judgeName: overrides.judgeName || 'Colvin', }); - await cerebralTest.runSequence('submitJudgeActivityReportSequence'); - await cerebralTest.runSequence('getCavAndSubmittedCasesForJudgesSequence', { + await cerebralTest.runSequence('submitJudgeActivityReportSequence', { selectedPage: 0, }); - const { progressDescriptionTableTotal } = runCompute( - judgeActivityReportHelper, - { - state: cerebralTest.getState(), - }, - ); + const { + closedCasesTotal, + opinionsFiledTotal, + ordersFiledTotal, + progressDescriptionTableTotal, + trialSessionsHeldTotal, + } = runCompute(judgeActivityReportHelper, { + state: cerebralTest.getState(), + }); cerebralTest.progressDescriptionTableTotal = progressDescriptionTableTotal; + cerebralTest.ordersFiledTotal = ordersFiledTotal; + cerebralTest.closedCasesTotal = closedCasesTotal; + cerebralTest.opinionsFiledTotal = opinionsFiledTotal; + cerebralTest.trialSessionsHeldTotal = trialSessionsHeldTotal; expect(cerebralTest.getState('validationErrors')).toEqual({}); expect( diff --git a/web-client/integration-tests/judgeActivityReportJourney.test.ts b/web-client/integration-tests/judgeActivityReportJourneyCavAndSubmittedCasesSearch.test.ts similarity index 98% rename from web-client/integration-tests/judgeActivityReportJourney.test.ts rename to web-client/integration-tests/judgeActivityReportJourneyCavAndSubmittedCasesSearch.test.ts index 1f5fec2bd21..7ddb016f29f 100644 --- a/web-client/integration-tests/judgeActivityReportJourney.test.ts +++ b/web-client/integration-tests/judgeActivityReportJourneyCavAndSubmittedCasesSearch.test.ts @@ -18,7 +18,7 @@ const judgeActivityReportHelper = withAppContextDecorator( let progressDescriptionTableTotalBefore = 0; -describe('Judge activity report journey', () => { +describe('Judge activity report journey - CAV and Submitted Cases Search', () => { const cerebralTest = setupTest(); afterAll(() => { diff --git a/web-client/integration-tests/judgeActivityReportJourneyClosedCasesSearch.test.ts b/web-client/integration-tests/judgeActivityReportJourneyClosedCasesSearch.test.ts new file mode 100644 index 00000000000..176defc0400 --- /dev/null +++ b/web-client/integration-tests/judgeActivityReportJourneyClosedCasesSearch.test.ts @@ -0,0 +1,83 @@ +import { docketClerkAddsDocketEntryFromOrder } from './journey/docketClerkAddsDocketEntryFromOrder'; +import { docketClerkCreatesAnOrder } from './journey/docketClerkCreatesAnOrder'; +import { docketClerkServesDocument } from './journey/docketClerkServesDocument'; +import { docketClerkSignsOrder } from './journey/docketClerkSignsOrder'; +import { docketClerkViewsDraftOrder } from './journey/docketClerkViewsDraftOrder'; +import { judgeActivityReportHelper as judgeActivityReportHelperComputed } from '../src/presenter/computeds/JudgeActivityReport/judgeActivityReportHelper'; +import { loginAs, setupTest } from './helpers'; +import { petitionsClerkCreatesNewCase } from './journey/petitionsClerkCreatesNewCase'; +import { runCompute } from '@web-client/presenter/test.cerebral'; +import { viewJudgeActivityReportResults } from './journey/viewJudgeActivityReportResults'; +import { withAppContextDecorator } from '../src/withAppContext'; + +const judgeActivityReportHelper = withAppContextDecorator( + judgeActivityReportHelperComputed, +); + +let closedCasesBefore = 0; + +describe('Judge activity report journey - Closed Cases Search', () => { + const cerebralTest = setupTest(); + + afterAll(() => { + cerebralTest.closeSocket(); + }); + + loginAs(cerebralTest, 'judgecolvin@example.com'); + it('should disable the submit button on initial page load when form has not yet been completed', async () => { + await cerebralTest.runSequence('gotoJudgeActivityReportSequence'); + + const { isFormPristine, reportHeader } = runCompute( + judgeActivityReportHelper, + { + state: cerebralTest.getState(), + }, + ); + + expect(isFormPristine).toBe(true); + expect(reportHeader).toContain('Colvin'); + }); + + it('should display an error message when invalid dates are entered into the form', async () => { + await cerebralTest.runSequence('setJudgeActivityReportFiltersSequence', { + startDate: '--_--', + }); + + await cerebralTest.runSequence('setJudgeActivityReportFiltersSequence', { + endDate: 'yabbadabaadooooo', + }); + + await cerebralTest.runSequence('submitJudgeActivityReportSequence'); + + expect(cerebralTest.getState('validationErrors')).toEqual({ + endDate: 'Enter a valid end date.', + startDate: 'Enter a valid start date.', + }); + }); + + // viewJudgeActivityReportResults(cerebralTest); + // it('should set the ordersCountBefore', () => { + // closedCasesBefore = cerebralTest.closedCasesTotal; + // }); + + // loginAs(cerebralTest, 'petitionsclerk@example.com'); + // petitionsClerkCreatesNewCase(cerebralTest); + + // loginAs(cerebralTest, 'docketclerk@example.com'); + // docketClerkCreatesAnOrder(cerebralTest, { + // documentTitle: 'Order of Dismissal for Lack of Jurisdiction', + // eventCode: 'ODJ', + // expectedDocumentType: 'Order of Dismissal for Lack of Jurisdiction', + // }); + // docketClerkViewsDraftOrder(cerebralTest); + // docketClerkSignsOrder(cerebralTest); + // docketClerkAddsDocketEntryFromOrder(cerebralTest, 0, 'Colvin'); + // docketClerkServesDocument(cerebralTest, 0); + + // loginAs(cerebralTest, 'judgecolvin@example.com'); + // viewJudgeActivityReportResults(cerebralTest, { judgeName: 'All Judges' }); + // it('should increase the closed cases count for closed cases for all judges', () => { + // const ordersCountAfter = cerebralTest.closedCasesTotal; + // expect(ordersCountAfter).toEqual(closedCasesBefore + 1); + // }); +}); diff --git a/web-client/integration-tests/judgeActivityReportJourneyOrdersAndOpinionsSearch.test.ts b/web-client/integration-tests/judgeActivityReportJourneyOrdersAndOpinionsSearch.test.ts new file mode 100644 index 00000000000..f4c9ac904d5 --- /dev/null +++ b/web-client/integration-tests/judgeActivityReportJourneyOrdersAndOpinionsSearch.test.ts @@ -0,0 +1,120 @@ +import { docketClerkAddsDocketEntryFromOrder } from './journey/docketClerkAddsDocketEntryFromOrder'; +import { docketClerkConvertsAnOrderToAnOpinion } from './journey/docketClerkConvertsAnOrderToAnOpinion'; +import { docketClerkCreatesAnOrder } from './journey/docketClerkCreatesAnOrder'; +import { docketClerkServesDocument } from './journey/docketClerkServesDocument'; +import { docketClerkSignsOrder } from './journey/docketClerkSignsOrder'; +import { docketClerkViewsDraftOrder } from './journey/docketClerkViewsDraftOrder'; +import { judgeActivityReportHelper as judgeActivityReportHelperComputed } from '../src/presenter/computeds/JudgeActivityReport/judgeActivityReportHelper'; +import { loginAs, setupTest } from './helpers'; +import { petitionsClerkCreatesNewCase } from './journey/petitionsClerkCreatesNewCase'; +import { runCompute } from '@web-client/presenter/test.cerebral'; +import { viewJudgeActivityReportResults } from './journey/viewJudgeActivityReportResults'; +import { withAppContextDecorator } from '../src/withAppContext'; + +const judgeActivityReportHelper = withAppContextDecorator( + judgeActivityReportHelperComputed, +); + +let ordersCountBefore = 0; +let opinionsCountBefore = 0; + +describe('Judge activity report journey - Orders and Opinions Search', () => { + const cerebralTest = setupTest(); + + afterAll(() => { + cerebralTest.closeSocket(); + }); + + loginAs(cerebralTest, 'judgecolvin@example.com'); + it('should disable the submit button on initial page load when form has not yet been completed', async () => { + await cerebralTest.runSequence('gotoJudgeActivityReportSequence'); + + const { isFormPristine, reportHeader } = runCompute( + judgeActivityReportHelper, + { + state: cerebralTest.getState(), + }, + ); + + expect(isFormPristine).toBe(true); + expect(reportHeader).toContain('Colvin'); + }); + + it('should display an error message when invalid dates are entered into the form', async () => { + await cerebralTest.runSequence('setJudgeActivityReportFiltersSequence', { + startDate: '--_--', + }); + + await cerebralTest.runSequence('setJudgeActivityReportFiltersSequence', { + endDate: 'yabbadabaadooooo', + }); + + await cerebralTest.runSequence('submitJudgeActivityReportSequence'); + + expect(cerebralTest.getState('validationErrors')).toEqual({ + endDate: 'Enter a valid end date.', + startDate: 'Enter a valid start date.', + }); + }); + + // viewJudgeActivityReportResults(cerebralTest); + // it('should set the ordersCountBefore', () => { + // ordersCountBefore = cerebralTest.ordersFiledTotal; + // }); + + // loginAs(cerebralTest, 'petitionsclerk@example.com'); + // petitionsClerkCreatesNewCase(cerebralTest); + + // loginAs(cerebralTest, 'docketclerk@example.com'); + // docketClerkCreatesAnOrder(cerebralTest, { + // documentTitle: 'Order', + // eventCode: 'O', + // expectedDocumentType: 'Order', + // }); + + // docketClerkViewsDraftOrder(cerebralTest); + // docketClerkSignsOrder(cerebralTest); + // docketClerkAddsDocketEntryFromOrder(cerebralTest, 0, 'Colvin'); + // docketClerkServesDocument(cerebralTest, 0); + + // docketClerkCreatesAnOrder(cerebralTest, { + // documentTitle: 'Order of Dismissal for Lack of Jurisdiction', + // eventCode: 'ODJ', + // expectedDocumentType: 'Order of Dismissal for Lack of Jurisdiction', + // }); + // docketClerkViewsDraftOrder(cerebralTest); + // docketClerkSignsOrder(cerebralTest); + // docketClerkAddsDocketEntryFromOrder(cerebralTest, 0, 'Colvin'); + // docketClerkServesDocument(cerebralTest, 0); + + // loginAs(cerebralTest, 'judgecolvin@example.com'); + // viewJudgeActivityReportResults(cerebralTest, { judgeName: 'All Judges' }); + // it('should increase the order count for all judges', () => { + // const ordersCountAfter = cerebralTest.ordersFiledTotal; + + // expect(ordersCountAfter).toEqual(ordersCountBefore + 2); + // }); + + // loginAs(cerebralTest, 'petitionsclerk@example.com'); + // petitionsClerkCreatesNewCase(cerebralTest); + + // it('should set the opinionsCountBefore', () => { + // opinionsCountBefore = cerebralTest.opinionsFiledTotal; + // }); + + // loginAs(cerebralTest, 'docketclerk@example.com'); + // docketClerkCreatesAnOrder(cerebralTest, { + // documentTitle: 'Order', + // eventCode: 'O', + // expectedDocumentType: 'Order', + // }); + // docketClerkViewsDraftOrder(cerebralTest); + // docketClerkConvertsAnOrderToAnOpinion(cerebralTest, 0); + + // loginAs(cerebralTest, 'judgecolvin@example.com'); + // viewJudgeActivityReportResults(cerebralTest, { judgeName: 'All Judges' }); + // it('should set the opinionsCountAfter', () => { + // const opinionsCountAfter = cerebralTest.opinionsFiledTotal; + // expect(opinionsCountAfter).toEqual(opinionsCountBefore + 1); + // }); +}); diff --git a/web-client/integration-tests/judgeActivityReportJourneyTrialSessions.test.ts b/web-client/integration-tests/judgeActivityReportJourneyTrialSessions.test.ts new file mode 100644 index 00000000000..d5e07ea68c1 --- /dev/null +++ b/web-client/integration-tests/judgeActivityReportJourneyTrialSessions.test.ts @@ -0,0 +1,194 @@ +import { docketClerkAddsCaseToHearing } from './journey/docketClerkAddsCaseToHearing'; +import { docketClerkCreatesATrialSession } from './journey/docketClerkCreatesATrialSession'; +import { docketClerkManuallyAddsCaseToTrialSessionWithNote } from './journey/docketClerkManuallyAddsCaseToTrialSessionWithNote'; +import { docketClerkManuallyAddsCaseToTrialSessionWithoutNote } from './journey/docketClerkManuallyAddsCaseToTrialSessionWithoutNote'; +import { docketClerkViewsNewTrialSession } from './journey/docketClerkViewsNewTrialSession'; +import { docketClerkViewsTrialSessionList } from './journey/docketClerkViewsTrialSessionList'; +import { judgeActivityReportHelper as judgeActivityReportHelperComputed } from '../src/presenter/computeds/JudgeActivityReport/judgeActivityReportHelper'; +import { loginAs, setupTest, uploadPetition } from './helpers'; +import { markAllCasesAsQCed } from './journey/markAllCasesAsQCed'; +import { petitionsClerkCompletesAndSetsTrialSession } from './journey/petitionsClerkCompletesAndSetsTrialSession'; +import { petitionsClerkSetsATrialSessionsSchedule } from './journey/petitionsClerkSetsATrialSessionsSchedule'; +import { petitionsClerkViewsNewTrialSession } from './journey/petitionsClerkViewsNewTrialSession'; +import { runCompute } from '@web-client/presenter/test.cerebral'; +import { viewJudgeActivityReportResults } from './journey/viewJudgeActivityReportResults'; +import { withAppContextDecorator } from '../src/withAppContext'; + +const judgeActivityReportHelper = withAppContextDecorator( + judgeActivityReportHelperComputed, +); + +let trialSessionsHeldBefore = 0; + +describe('Judge activity report journey', () => { + const trialLocation1 = `Despacito, Texas, ${Date.now()}`; + const trialLocation2 = `Los Angeles, California, ${Date.now()}`; + const trialLocation3 = `Charlotte, NC, ${Date.now()}`; + + const overrides1 = { + judge: 'Colvin', + maxCases: 2, + preferredTrialCity: trialLocation1, + sessionType: 'Regular', + trialLocation: trialLocation1, + }; + + const overrides2 = { + judge: 'Colvin', + maxCases: 3, + preferredTrialCity: trialLocation1, + sessionType: 'Regular', + trialLocation: trialLocation2, + }; + + const overrides3 = { + judge: 'Colvin', + maxCases: 13, + preferredTrialCity: trialLocation3, + sessionType: 'Regular', + trialLocation: trialLocation3, + }; + + const cerebralTest = setupTest(); + cerebralTest.createdTrialSessions = []; + cerebralTest.createdCases = []; + afterAll(() => { + cerebralTest.closeSocket(); + }); + + loginAs(cerebralTest, 'judgecolvin@example.com'); + it('should disable the submit button on initial page load when form has not yet been completed', async () => { + await cerebralTest.runSequence('gotoJudgeActivityReportSequence'); + + const { isFormPristine, reportHeader } = runCompute( + judgeActivityReportHelper, + { + state: cerebralTest.getState(), + }, + ); + + expect(isFormPristine).toBe(true); + expect(reportHeader).toContain('Colvin'); + }); + + it('should display an error message when invalid dates are entered into the form', async () => { + await cerebralTest.runSequence('setJudgeActivityReportFiltersSequence', { + startDate: '--_--', + }); + + await cerebralTest.runSequence('setJudgeActivityReportFiltersSequence', { + endDate: 'yabbadabaadooooo', + }); + + await cerebralTest.runSequence('submitJudgeActivityReportSequence'); + + expect(cerebralTest.getState('validationErrors')).toEqual({ + endDate: 'Enter a valid end date.', + startDate: 'Enter a valid start date.', + }); + }); + + viewJudgeActivityReportResults(cerebralTest); + it('should set the trialSessionsBefore', () => { + trialSessionsHeldBefore = cerebralTest.trialSessionsHeldTotal; + console.log('trialSessionsHeldBefore', trialSessionsHeldBefore); + }); + + // CREATE FIRST TRIAL SESSION ADD CASE AND SET THE CALENDAR ON THE CASE + // loginAs(cerebralTest, 'docketclerk@example.com'); + // docketClerkCreatesATrialSession(cerebralTest, overrides1); + // docketClerkViewsNewTrialSession(cerebralTest); + // loginAs(cerebralTest, 'petitioner@example.com'); + // it('creates a case', async () => { + // const caseDetail = await uploadPetition(cerebralTest, overrides1); + // expect(caseDetail.docketNumber).toBeDefined(); + // cerebralTest.docketNumber = caseDetail.docketNumber; + // }); + + // loginAs(cerebralTest, 'docketclerk@example.com'); + // docketClerkManuallyAddsCaseToTrialSessionWithoutNote(cerebralTest); + + // loginAs(cerebralTest, 'petitionsclerk@example.com'); + // petitionsClerkCompletesAndSetsTrialSession(cerebralTest, { + // judge: overrides1.judge, + // }); + + // CREATE SECOND TRIAL SESSION ADD CASE AND SET THE CALENDAR ON THE CASE + // loginAs(cerebralTest, 'docketclerk@example.com'); + // docketClerkCreatesATrialSession(cerebralTest, overrides2); + // loginAs(cerebralTest, 'petitioner@example.com'); + // it('creates a case', async () => { + // const caseDetail = await uploadPetition(cerebralTest, overrides2); + // expect(caseDetail.docketNumber).toBeDefined(); + // cerebralTest.docketNumber = caseDetail.docketNumber; + // }); + + // loginAs(cerebralTest, 'docketclerk@example.com'); + // docketClerkManuallyAddsCaseToTrialSessionWithoutNote(cerebralTest); + + // loginAs(cerebralTest, 'petitionsclerk@example.com'); + // petitionsClerkCompletesAndSetsTrialSession(cerebralTest, { + // judge: overrides2.judge, + // }); + + // CREATE THIRD TRIAL SESSION ADD CASE AND SET THE CALENDAR ON THE CASE + // cerebralTest.createdTrialSessions = []; + // loginAs(cerebralTest, 'docketclerk@example.com'); + // docketClerkCreatesATrialSession(cerebralTest, overrides3); + // loginAs(cerebralTest, 'petitioner@example.com'); + // it('creates a case', async () => { + // const caseDetail = await uploadPetition(cerebralTest, overrides3); + // expect(caseDetail.docketNumber).toBeDefined(); + // cerebralTest.docketNumber = caseDetail.docketNumber; + // }); + + // loginAs(cerebralTest, 'docketclerk@example.com'); + // docketClerkManuallyAddsCaseToTrialSessionWithoutNote(cerebralTest); + + // loginAs(cerebralTest, 'petitionsclerk@example.com'); + // petitionsClerkViewsNewTrialSession(cerebralTest); + // markAllCasesAsQCed(cerebralTest, () => [cerebralTest.docketNumber]); + // petitionsClerkSetsATrialSessionsSchedule(cerebralTest); + + // loginAs(cerebralTest, 'judgecolvin@example.com'); + // viewJudgeActivityReportResults(cerebralTest, { judgeName: 'All Judges' }); + + loginAs(cerebralTest, 'docketclerk@example.com'); + docketClerkCreatesATrialSession(cerebralTest, overrides1); + docketClerkViewsTrialSessionList(cerebralTest); + docketClerkViewsNewTrialSession(cerebralTest, false); + docketClerkCreatesATrialSession(cerebralTest, overrides2); + docketClerkViewsTrialSessionList(cerebralTest); + docketClerkViewsNewTrialSession(cerebralTest, false); + + loginAs(cerebralTest, 'petitioner@example.com'); + it('create case 1', async () => { + const caseDetail = await uploadPetition(cerebralTest, overrides1); + expect(caseDetail.docketNumber).toBeDefined(); + cerebralTest.docketNumber = caseDetail.docketNumber; + cerebralTest.createdCases.push(cerebralTest.docketNumber); + }); + + loginAs(cerebralTest, 'docketclerk@example.com'); + docketClerkManuallyAddsCaseToTrialSessionWithNote(cerebralTest); + docketClerkAddsCaseToHearing(cerebralTest, 'Test hearing note one.'); + docketClerkViewsNewTrialSession(cerebralTest, true, 'Test hearing note one.'); + + loginAs(cerebralTest, 'petitionsclerk@example.com'); + petitionsClerkViewsNewTrialSession(cerebralTest); + markAllCasesAsQCed(cerebralTest, () => [cerebralTest.docketNumber]); + + console.log( + 'HERE TO SEE IF DOCKET CLERK is opened', + cerebralTest.lastCreatedTrialSessionId, + ); + loginAs(cerebralTest, 'docketclerk@example.com'); + docketClerkViewsTrialSessionList(cerebralTest); + + it('should increase the trial session count for all judges', () => { + console.log('trialsessions number', cerebralTest.trialSessionsHeldTotal); + + // const trialSessionsHeldAfter = cerebralTest.trialSessionsHeldTotal; + // expect(trialSessionsHeldAfter).toEqual(trialSessionsHeldBefore + 2); + }); +}); diff --git a/web-client/src/presenter/computeds/JudgeActivityReport/judgeActivityReportHelper.ts b/web-client/src/presenter/computeds/JudgeActivityReport/judgeActivityReportHelper.ts index be833b34599..9c43108b04f 100644 --- a/web-client/src/presenter/computeds/JudgeActivityReport/judgeActivityReportHelper.ts +++ b/web-client/src/presenter/computeds/JudgeActivityReport/judgeActivityReportHelper.ts @@ -124,6 +124,8 @@ export const judgeActivityReportHelper = ( CAV_AND_SUBMITTED_CASES_PAGE_SIZE, ); + console.log('TRIAL SESSIONS IN HELPER', trialSessionsHeldTotal); + return { closedCasesTotal, filteredSubmittedAndCavCasesByJudge,