diff --git a/.evergreen.yml b/.evergreen.yml index 36ae9a03b8..6dc2f03761 100644 --- a/.evergreen.yml +++ b/.evergreen.yml @@ -6,11 +6,13 @@ ignore: modules: - name: evergreen - repo: git@github.com:evergreen-ci/evergreen.git + owner: evergreen-ci + repo: evergreen branch: main auto_update: true - name: logkeeper - repo: git@github.com:evergreen-ci/logkeeper.git + owner: evergreen-ci + repo: logkeeper branch: main auto_update: true @@ -243,7 +245,7 @@ functions: if [[ "${requester}" == "github_pr" || "${requester}" == "commit" ]]; then yarn cy:run --record --key "${cypress_record_key}" --reporter junit elif [[ "${requester}" == "patch" ]]; then - yarn cy:run --record --key "${cypress_record_key}" --reporter junit --spec ${cypress_spec} + yarn cy:run --record --key "${cypress_record_key}" --reporter junit --spec "${cypress_spec}" else yarn cy:run --reporter junit fi @@ -524,5 +526,5 @@ buildvariants: parameters: - key: cypress_spec - value: "cypress/integration/**/*" + value: cypress/integration/**/* description: Specify the Cypress spec files to run for user submitted patches running the e2e_test task. diff --git a/README.md b/README.md index c49280f869..74c38b2a8c 100644 --- a/README.md +++ b/README.md @@ -2,32 +2,19 @@ Spruce is the React UI for MongoDB's continuous integration software. -## Table of Contents - -- [Getting Started](#getting-started) - - [Running Locally](#running-locally) - - [Environment Variables](#environment-variables) -- [Deployment](#deployment) - - [Requirements](#requirements) - - [How to Deploy](#how-to-deploy) - ## Getting Started ### Running Locally -1. Clone the Spruce Github repository -2. Ensure you have Node.js v16+ and MongoDB Command Line Database Tools +1. Clone the Spruce GitHub repository +2. Ensure you have Node.js v20+ and MongoDB Command Line Database Tools v100.8.0+ installed -3. Ask a colleague for their .cmdrc.json file and follow the instructions - [here](#environment-variables) -4. Run `yarn` -5. Start a local evergreen server by doing the following: - -- Clone the evergreen repo -- Run `make local-evergreen` - -6. Run `yarn run dev`. This will launch the app and point it at the local - evergreen server you just ran. +3. Run `yarn install` +4. Start a local Evergreen server by doing the following: + - Clone the [Evergreen repo](https://github.com/evergreen-ci/evergreen) + - From the Evergreen directory, run `make local-evergreen` +5. Run `yarn run dev`. This will launch the app and point it at the local + Evergreen server you just started. ### Storybook @@ -47,11 +34,11 @@ results. 1. Symlink the standard definition language GraphQL schema used in your backend to a file named sdlschema in the root of the Spruce directory to enable query - linting with ESlint like so + linting with ESLint like so `ln -s /graphql/schema sdlschema` 2. Run `yarn run eslint` to see the results of query linting in your terminal or install a plugin to integrate ESlint into your editor. If you are using - VSCode, we recommend ESLint by Dirk Baeumer. + VS Code, we recommend ESLint by Dirk Baeumer. ### Environment Variables @@ -62,11 +49,11 @@ with non-sensitive information, and `.env-cmdrc.json` for builds deployed to S3. This file is git ignored because it contains API keys that we do not want to publish. It should be named `.env-cmdrc.json` and placed in the root of the project. This file is required to deploy Spruce to production and to staging. -The credential file is located in the R&D Dev Prod 1password vault. +The credential file is located in the R&D Dev Prod 1Password vault. ## GraphQL Type Generation -We use Code generation to generate our types for our GraphQL queries and +We use code generation to generate our types for our GraphQL queries and mutations. When you create a query or mutation you can run the code generation script with the steps below. The types for your query/mutation response and variables will be generated and saved to `gql/generated/types.ts`. Much of the @@ -75,12 +62,15 @@ well and you can refer to those before creating your own. ### Setting up code generation -- create a symlink from the `schema` folder from evergreen with the spruce - folder using `ln -s /graphql/schema sdlschema` +- Create a symlink from the `schema` folder from Evergreen to Spruce using + +```bash +ln -s /graphql/schema sdlschema +``` ### Using code generation -- From within the spruce folder run `yarn codegen` +- From within the Spruce folder run `yarn codegen` - As long as your queries are declared correctly the types should generate ### Code generation troubleshooting and tips @@ -88,8 +78,8 @@ well and you can refer to those before creating your own. - Queries should be declared with a query name so the code generation knows what to name the corresponding type. - Each query and mutation should have a unique name. -- Since query analysis for type generation occurs statically we cant place - dynamic variables with in query strings we instead have to hard code the +- Since query analysis for type generation occurs statically we can't place + dynamic variables with in query strings. We instead have to hard code the variable in the query or pass it in as query variable. ### Common errors @@ -107,47 +97,44 @@ Cypress. ### Unit tests -Unit Tests are used to test individual features in isolation. We utilize the -[Jest Test Runner](https://jestjs.io/) to execute our Unit Tests and generate +Unit tests are used to test individual features in isolation. We utilize the +[Jest Test Runner](https://jestjs.io/) to execute our unit tests and generate reports. There are 3 types of unit tests you may encounter in this codebase. #### Component Tests -These test React Componenents. We utilize +These test React components. We utilize [React Testing Library](https://testing-library.com/docs/react-testing-library/intro/) to help us write our component tests. React Testing Library provides several utilities that are useful for making assertions on React Componenents. When writing component tests you should import [test_utils](https://github.com/evergreen-ci/spruce/blob/main/src/test_utils/index.tsx) -instead of React Testing Library, `test_utils` is a wrapper around React Testing +instead of React Testing Library; `test_utils` is a wrapper around React Testing Library which provides a series of helpful utilities for common testing -scenarios such as `queryByDataCy` which is a helper for selecting `data-cy` -attributes or `renderWithRouterMatch` which is helpful for testing components +scenarios such as `queryByDataCy`, which is a helper for selecting `data-cy` +attributes, or `renderWithRouterMatch`, which is helpful for testing components that rely on React Router. #### Hook Tests Often times you may find yourself writing -[custom react hooks](https://reactjs.org/docs/hooks-custom.html). The best way -to test these is using -[React Hooks Testing Library](https://react-hooks-testing-library.com/). React -Hooks Testing Library allows you to test your custom Hooks in isolation without -needing to wrap them in a Component. It provides several methods that make it -easy to assert and test different behaviors in your hooks. Such as -[`waitForNextUpdate`](https://react-hooks-testing-library.com/reference/api#waitfornextupdate) +[custom React hooks](https://reactjs.org/docs/hooks-custom.html). The best way +to test these is using React Testing Library's [`renderHook`](https://testing-library.com/docs/react-testing-library/api#renderhook) utility. This allows you to test your custom hooks in isolation without +needing to wrap them in a component. It provides several methods that make it +easy to assert and test different behaviors in your hooks. Such as [`waitFor`](https://testing-library.com/docs/dom-testing-library/api-async/#waitfor), which will wait for your hook to rerender before allowing a test to proceed. #### Standard utility tests These are the most basic of tests. They do not require any special libraries to -run and often just test standard javascript functions. +run and often just test standard JavaScript functions. -- You can run all Unit Tests using `yarn test` -- You can run a specific Unit Test using `yarn test -t ` -- You can run jest in watch mode using `yarn test:watch` This will open an - interactive CLI you can use to automatically run tests as you update them. +- You can run all unit tests using `yarn test` +- You can run a specific unit test using `yarn test -t ` +- You can run Jest in watch mode using `yarn test:watch` This will open an + interactive CLI that can be used to automatically run tests as you update them. ### E2E tests @@ -155,10 +142,10 @@ At a high level, we use [Cypress](https://www.cypress.io/) to start a virtual browser that is running Spruce. Cypress then is able to run our test specs, which tell it to interact with the browser in certain ways and makes assertions about what happens in the UI. Note that you must be running the Evergreen server -on localhost:9090 for the front-end to work. +on http://localhost:9090 for the front-end to work. In order to run the Cypress tests, do the following, assuming you have this repo -checked out and all the dependencies installed by yarn: +checked out and all the dependencies installed by Yarn: 1. Increase the limit on open files by running `ulimit -n 64000` before running mongod in the same shell. @@ -177,16 +164,16 @@ checked out and all the dependencies installed by yarn: ### Snapshot Tests -Snapshot tests are automatically generated when we create storybook stories. -These Tests create a snapshot of the UI and compare them to previous snapshots -which are stored as files along side your storybook stories in a `__snapshots__` +Snapshot tests are automatically generated when we create Storybook stories. +These tests create a snapshot of the UI and compare them to previous snapshots +which are stored as files along side your Storybook stories in a `__snapshots__` directory. They try to catch unexpected UI regressions. Read more about them -[Here](https://jestjs.io/docs/snapshot-testing). +[here](https://jestjs.io/docs/snapshot-testing). ## How to get data for your feature -If you need more data to be able to test out your feature locally the easiest -way to do it is to populate the local db using real data from the staging or +If you need more data to be able to test out your feature locally, the easiest +way to do so is to populate the local db using real data from the staging or production environments. 1. You should identify if the data you need is located in the staging or prod db @@ -244,12 +231,12 @@ so you don't accidently export an entire collection you can do this by passing a ### Logkeeper -Spruce has a minimal dependency on Logkeeper: it is used for Cypress tests on +Spruce has a minimal dependency on Logkeeper: it is used by Cypress tests on the Job Logs page. If you'd like to get set up to develop these tests, complete the following: -1. Clone the [Logkeeper Repository](https://github.com/evergreen-ci/logkeeper) -2. Run `yarn bootstrap-logkeeper` to download some sample resmoke logs from S3. +1. Clone the [Logkeeper repository](https://github.com/evergreen-ci/logkeeper) +2. Run `yarn bootstrap-logkeeper` within Spruce to download some sample resmoke logs from S3. 3. Run the command output by the previous step to seed the env variables and start the local logkeeper server at http://localhost:8080. @@ -257,9 +244,9 @@ the following: ### Requirements -You must be on the `main` Branch if deploying to prod. +You must be on the `main` branch if deploying to prod. -A `.cmdrc.json` file is required to deploy because it sets the environment +An `.env-cmdrc.json` file is required to deploy because it sets the environment variables that the application needs in production and staging environments. See [Environment Variables](#environment-variables) section for more info about this file. diff --git a/codegen.ts b/codegen.ts index 650679d02e..a4bfd7b2c1 100644 --- a/codegen.ts +++ b/codegen.ts @@ -8,7 +8,7 @@ export const getConfig = ({ generatedFileName: string; } & Pick): CodegenConfig => ({ documents: ["./src/**/*.ts", "./src/**/*.graphql", "./src/**/*.gql"].map( - (d) => path.resolve(__dirname, d) + (d) => path.resolve(__dirname, d), ), generates: { [generatedFileName]: { @@ -36,7 +36,7 @@ export const getConfig = ({ export const generatedFileName = path.resolve( __dirname, - "./src/gql/generated/types.ts" + "./src/gql/generated/types.ts", ); export default getConfig({ diff --git a/cypress/integration/banners/slack_notification_banner.ts b/cypress/integration/banners/slack_notification_banner.ts index f6060efeae..85be56016d 100644 --- a/cypress/integration/banners/slack_notification_banner.ts +++ b/cypress/integration/banners/slack_notification_banner.ts @@ -16,7 +16,7 @@ describe("Slack notification banner", () => { cy.dataCy(slackNotificationBanner).should("exist"); cy.visit( - "/task/evergreen_ubuntu1604_dist_patch_33016573166a36bd5f46b4111151899d5c4e95b1_5ecedafb562343215a7ff297_20_05_27_21_39_46/logs?execution=1" + "/task/evergreen_ubuntu1604_dist_patch_33016573166a36bd5f46b4111151899d5c4e95b1_5ecedafb562343215a7ff297_20_05_27_21_39_46/logs?execution=1", ); cy.dataCy(slackNotificationBanner).should("exist"); }); @@ -33,7 +33,7 @@ describe("Slack notification banner", () => { cy.dataCy(slackNotificationBanner).should("not.exist"); cy.validateToast( "success", - "You will now receive Slack notifications when your patches fail or succeed" + "You will now receive Slack notifications when your patches fail or succeed", ); cy.visit("/preferences/notifications"); diff --git a/cypress/integration/breadcrumbs.ts b/cypress/integration/breadcrumbs.ts index 5f54d133ac..5f63587406 100644 --- a/cypress/integration/breadcrumbs.ts +++ b/cypress/integration/breadcrumbs.ts @@ -2,7 +2,7 @@ describe("Viewing a patch", () => { describe("Viewing a user's own patch", () => { beforeEach(() => { cy.visit( - "/task/mci_ubuntu1604_test_command_patch_a1d2c8f70bf5c543de8b9641ac1ec08def1ddb26_5f74d99ab2373627c047c5e5_20_09_30_19_16_47" + "/task/mci_ubuntu1604_test_command_patch_a1d2c8f70bf5c543de8b9641ac1ec08def1ddb26_5f74d99ab2373627c047c5e5_20_09_30_19_16_47", ); }); it("Clicking on the display task breadcrumb should take you to that task", () => { @@ -10,7 +10,7 @@ describe("Viewing a patch", () => { cy.dataCy("bc-display-task").click(); cy.url().should( "include", - "/task/mci_ubuntu1604_display_asdf_patch_a1d2c8f70bf5c543de8b9641ac1ec08def1ddb26_5f74d99ab2373627c047c5e5_20_09_30_19_16_47" + "/task/mci_ubuntu1604_display_asdf_patch_a1d2c8f70bf5c543de8b9641ac1ec08def1ddb26_5f74d99ab2373627c047c5e5_20_09_30_19_16_47", ); }); it("Clicking the 'My Patches' breadcrumb goes to the logged in user's Patches Page when the current patch belongs to the logged in user", () => { @@ -21,7 +21,7 @@ describe("Viewing a patch", () => { describe("Viewing another user's patch", () => { beforeEach(() => { cy.visit( - "/task/evergreen_ubuntu1604_dist_patch_33016573166a36bd5f46b4111151899d5c4e95b1_5ecedafb562343215a7ff297_20_05_27_21_39_46" + "/task/evergreen_ubuntu1604_dist_patch_33016573166a36bd5f46b4111151899d5c4e95b1_5ecedafb562343215a7ff297_20_05_27_21_39_46", ); }); it("Clicking on the patch name breadcrumb from a task should take you to that version", () => { @@ -40,13 +40,13 @@ describe("Viewing a patch", () => { describe("Viewing a mainline commit", () => { beforeEach(() => { cy.visit( - "/task/evergreen_ubuntu1604_test_service_patch_5e823e1f28baeaa22ae00823d83e03082cd148ab_5e4ff3abe3c3317e352062e4_20_02_21_15_13_48" + "/task/evergreen_ubuntu1604_test_service_patch_5e823e1f28baeaa22ae00823d83e03082cd148ab_5e4ff3abe3c3317e352062e4_20_02_21_15_13_48", ); }); it("Clicking the commit message breadcrumb from a task should take you to that version", () => { cy.dataCy("bc-message").should( "include.text", - "5e823e1 - 'ever…reen/pull/3186)" + "5e823e1 - 'ever…reen/pull/3186)", ); cy.dataCy("bc-message").click(); cy.url().should("include", "/version/5e4ff3abe3c3317e352062e4"); diff --git a/cypress/integration/commit_queue.ts b/cypress/integration/commit_queue.ts index 81d637f06b..24d51ad3c8 100644 --- a/cypress/integration/commit_queue.ts +++ b/cypress/integration/commit_queue.ts @@ -54,7 +54,7 @@ describe("commit queue page", () => { cy.dataCy("commit-queue-message").should("exist"); cy.dataCy("commit-queue-message").should( "contain.text", - "This is the commit queue" + "This is the commit queue", ); }); @@ -68,8 +68,8 @@ describe("commit queue page", () => { "some other commit", "crazy cool commit!!!", "mega commit", - ][index] - ) + ][index], + ), ); }); }); diff --git a/cypress/integration/container/container_events.ts b/cypress/integration/container/container_events.ts index 2c4c18c7f6..d92a0d43b2 100644 --- a/cypress/integration/container/container_events.ts +++ b/cypress/integration/container/container_events.ts @@ -48,7 +48,7 @@ describe("Container events", () => { .should( "have.attr", "href", - "/task/logkeeper_ubuntu_test_edd78c1d581bf757a880777b00685321685a8e67_16_10_20_21_58_58?execution=0" + "/task/logkeeper_ubuntu_test_edd78c1d581bf757a880777b00685321685a8e67_16_10_20_21_58_58?execution=0", ); }); }); diff --git a/cypress/integration/distroSettings/general_section.ts b/cypress/integration/distroSettings/general_section.ts index 1fdd8a8e3c..c28f276fbe 100644 --- a/cypress/integration/distroSettings/general_section.ts +++ b/cypress/integration/distroSettings/general_section.ts @@ -9,7 +9,7 @@ describe("general section", () => { cy.dataCy("save-settings-button").should( "have.attr", "aria-disabled", - "true" + "true", ); // Update fields. @@ -27,7 +27,7 @@ describe("general section", () => { cy.getInputByLabel("Alias").should("have.value", "localhost-alias"); cy.getInputByLabel("Notes").should("have.value", "this is a note"); cy.getInputByLabel("Disable shallow clone for this distro").should( - "be.checked" + "be.checked", ); // Undo changes. @@ -47,7 +47,7 @@ describe("general section", () => { it("warns users that the distro will not be spawned for tasks", () => { cy.contains( - "Distro is a container pool, so it cannot be spawned for tasks." + "Distro is a container pool, so it cannot be spawned for tasks.", ).should("be.visible"); }); }); diff --git a/cypress/integration/distroSettings/host_section.ts b/cypress/integration/distroSettings/host_section.ts index 2b03d4473d..763ab99edb 100644 --- a/cypress/integration/distroSettings/host_section.ts +++ b/cypress/integration/distroSettings/host_section.ts @@ -19,7 +19,7 @@ describe("host section", () => { it("shows an error when selecting an incompatible host communication method", () => { cy.selectLGOption("Host Communication Method", "RPC"); cy.contains( - "Legacy and non-legacy bootstrapping and communication are incompatible." + "Legacy and non-legacy bootstrapping and communication are incompatible.", ); }); @@ -33,7 +33,7 @@ describe("host section", () => { cy.getInputByLabel("SSH Option").type("BatchMode=yes"); cy.selectLGOption( "Host Overallocation Rule", - "Terminate hosts when overallocated" + "Terminate hosts when overallocated", ); save(); @@ -96,7 +96,7 @@ describe("host section", () => { cy.getInputByLabel("Client Directory").type("/client/dir"); cy.getInputByLabel("Shell Path").type("/shell/path"); cy.getInputByLabel("Home Volume Format Command").type( - "echo 'Hello World'" + "echo 'Hello World'", ); cy.getInputByLabel("Number of Files").type("10"); cy.getInputByLabel("Number of CGroup Tasks").type("20"); diff --git a/cypress/integration/distroSettings/navigation.ts b/cypress/integration/distroSettings/navigation.ts index 9d92d620e6..a3c0076c41 100644 --- a/cypress/integration/distroSettings/navigation.ts +++ b/cypress/integration/distroSettings/navigation.ts @@ -19,7 +19,7 @@ describe("using the distro dropdown", () => { cy.dataCy("save-settings-button").should( "not.have.attr", "aria-disabled", - "true" + "true", ); cy.dataCy("project-health-link").click(); cy.dataCy("navigation-warning-modal").should("be.visible"); @@ -27,7 +27,7 @@ describe("using the distro dropdown", () => { cy.dataCy("navigation-warning-modal").should("not.exist"); cy.location("pathname").should( "eq", - "/distro/localhost/settings/general" + "/distro/localhost/settings/general", ); }); @@ -41,7 +41,7 @@ describe("using the distro dropdown", () => { cy.dataCy("save-settings-button").should( "not.have.attr", "aria-disabled", - "true" + "true", ); cy.contains("a", "Task Settings").click(); cy.dataCy("save-modal").should("be.visible"); @@ -53,7 +53,7 @@ describe("using the distro dropdown", () => { cy.dataCy("save-settings-button").should( "not.have.attr", "aria-disabled", - "true" + "true", ); cy.dataCy("project-health-link").click(); cy.dataCy("navigation-warning-modal").should("be.visible"); diff --git a/cypress/integration/distroSettings/new_distro.ts b/cypress/integration/distroSettings/new_distro.ts index 138bf1933a..a362de2895 100644 --- a/cypress/integration/distroSettings/new_distro.ts +++ b/cypress/integration/distroSettings/new_distro.ts @@ -17,13 +17,13 @@ describe("Creating a new distro", () => { cy.validateToast("success"); cy.location("pathname").should( "eq", - `/distro/${newDistroId}/settings/general` + `/distro/${newDistroId}/settings/general`, ); cy.dataCy("delete-distro-button").should( "have.attr", "aria-disabled", - "false" + "false", ); cy.dataCy("delete-distro-button").click(); cy.dataCy("delete-distro-modal").should("be.visible"); @@ -52,13 +52,13 @@ describe("Copying a distro", () => { cy.validateToast("success"); cy.location("pathname").should( "eq", - `/distro/${copyDistroId}/settings/general` + `/distro/${copyDistroId}/settings/general`, ); cy.dataCy("delete-distro-button").should( "have.attr", "aria-disabled", - "false" + "false", ); cy.dataCy("delete-distro-button").click(); cy.dataCy("delete-distro-modal").should("be.visible"); diff --git a/cypress/integration/distroSettings/on_save_operations.ts b/cypress/integration/distroSettings/on_save_operations.ts index 8fff5edc5a..a14017ecf5 100644 --- a/cypress/integration/distroSettings/on_save_operations.ts +++ b/cypress/integration/distroSettings/on_save_operations.ts @@ -12,7 +12,7 @@ describe("using an on-save operation", () => { save(DistroOnSaveOperation.Decommission); cy.validateToast( "success", - "Updated distro and scheduled 0 hosts to update." + "Updated distro and scheduled 0 hosts to update.", ); // Reset field @@ -20,7 +20,7 @@ describe("using an on-save operation", () => { save(DistroOnSaveOperation.RestartJasper); cy.validateToast( "success", - "Updated distro and scheduled 0 hosts to update." + "Updated distro and scheduled 0 hosts to update.", ); }); }); diff --git a/cypress/integration/distroSettings/permissions.ts b/cypress/integration/distroSettings/permissions.ts index 370c9841d8..0a6ac234e4 100644 --- a/cypress/integration/distroSettings/permissions.ts +++ b/cypress/integration/distroSettings/permissions.ts @@ -20,7 +20,7 @@ describe("with various permission levels", () => { cy.dataCy("delete-distro-button").should( "not.have.attr", "aria-disabled", - "true" + "true", ); cy.get("textarea").should("not.be.disabled"); }); @@ -46,7 +46,7 @@ describe("with various permission levels", () => { cy.dataCy("delete-distro-button").should( "have.attr", "aria-disabled", - "true" + "true", ); cy.get("textarea").should("not.be.disabled"); }); @@ -72,7 +72,7 @@ describe("with various permission levels", () => { cy.dataCy("delete-distro-button").should( "have.attr", "aria-disabled", - "true" + "true", ); cy.dataCy("distro-settings-page").within(() => { cy.get("input").should("be.disabled"); diff --git a/cypress/integration/distroSettings/project_section.ts b/cypress/integration/distroSettings/project_section.ts index 1ecc548466..5a2154e7d1 100644 --- a/cypress/integration/distroSettings/project_section.ts +++ b/cypress/integration/distroSettings/project_section.ts @@ -9,7 +9,7 @@ describe("project section", () => { cy.dataCy("save-settings-button").should( "have.attr", "aria-disabled", - "true" + "true", ); // Update fields. diff --git a/cypress/integration/distroSettings/provider_section.ts b/cypress/integration/distroSettings/provider_section.ts index b4b026f6ed..4a0213e6ac 100644 --- a/cypress/integration/distroSettings/provider_section.ts +++ b/cypress/integration/distroSettings/provider_section.ts @@ -44,7 +44,7 @@ describe("provider section", () => { it("shows pool mapping information based on container pool id", () => { cy.getInputByLabel("Container Pool ID").should( "contain.text", - "test-pool-1" + "test-pool-1", ); cy.getInputByLabel("Pool Mapping Information") .should("have.attr", "placeholder") diff --git a/cypress/integration/distroSettings/task_section.ts b/cypress/integration/distroSettings/task_section.ts index 980a786e73..f84a9bdd62 100644 --- a/cypress/integration/distroSettings/task_section.ts +++ b/cypress/integration/distroSettings/task_section.ts @@ -40,7 +40,7 @@ describe("task section", () => { cy.dataCy("save-settings-button").should( "have.attr", "aria-disabled", - "true" + "true", ); // Update fields. @@ -54,15 +54,15 @@ describe("task section", () => { cy.reload(); cy.getInputByLabel("Task Finder Version").should( "contain.text", - "Parallel" + "Parallel", ); cy.getInputByLabel("Task Planner Version").should( "contain.text", - "Tunable" + "Tunable", ); cy.getInputByLabel("Task Dispatcher Version").should( "contain.text", - "Revised with dependencies" + "Revised with dependencies", ); // Undo changes. diff --git a/cypress/integration/host/host_buttons.ts b/cypress/integration/host/host_buttons.ts index 435f4618f5..ea2f8baf7a 100644 --- a/cypress/integration/host/host_buttons.ts +++ b/cypress/integration/host/host_buttons.ts @@ -24,7 +24,7 @@ describe("Host page restart jasper, reprovision, and update host status buttons" cy.contains("button", "Update").should( "not.have.attr", "aria-disabled", - "true" + "true", ); cy.contains("button", "Update").click({ force: true }); }); diff --git a/cypress/integration/host/host_core.ts b/cypress/integration/host/host_core.ts index 950a1cb108..98eefdd023 100644 --- a/cypress/integration/host/host_core.ts +++ b/cypress/integration/host/host_core.ts @@ -10,7 +10,7 @@ describe("Host page title is displayed ", () => { cy.visit(`host/macos-1014-68.macstadium.build.10gen`); cy.dataCy("page-title").should( "include.text", - "Host: macos-1014-68.macstadium.build.10gen" + "Host: macos-1014-68.macstadium.build.10gen", ); }); }); diff --git a/cypress/integration/host/host_events.ts b/cypress/integration/host/host_events.ts index 582c2fdba1..a68ce869fb 100644 --- a/cypress/integration/host/host_events.ts +++ b/cypress/integration/host/host_events.ts @@ -212,7 +212,7 @@ describe("Host events", () => { cy.contains("button", "Save Changes").click(); cy.visit(pathWithEvents); cy.dataCy("HOST_JASPER_RESTARTING-time").contains( - "Sep 30, 2017, 9:11:16 AM" + "Sep 30, 2017, 9:11:16 AM", ); // Reset timezone so re-running this test works. cy.visit("/preferences"); diff --git a/cypress/integration/host/host_sidebar.ts b/cypress/integration/host/host_sidebar.ts index 22e2611793..545f44b556 100644 --- a/cypress/integration/host/host_sidebar.ts +++ b/cypress/integration/host/host_sidebar.ts @@ -6,7 +6,7 @@ describe("Host page title and sidebar ", () => { cy.visit(pathNoTask); cy.dataCy("page-title").should( "include.text", - "Host: macos-1014-68.macstadium.build.10gen" + "Host: macos-1014-68.macstadium.build.10gen", ); }); @@ -24,7 +24,7 @@ describe("Host page title and sidebar ", () => { it("sshCommand has the correct values", () => { cy.visit(pathWithTask); cy.dataCy("ssh-command").contains( - "ssh admin@ec2-54-146-18-248.compute-1.amazonaws.com" + "ssh admin@ec2-54-146-18-248.compute-1.amazonaws.com", ); }); }); diff --git a/cypress/integration/hosts/host_filtering.ts b/cypress/integration/hosts/host_filtering.ts index 2750d06167..a1e4491c8a 100644 --- a/cypress/integration/hosts/host_filtering.ts +++ b/cypress/integration/hosts/host_filtering.ts @@ -113,7 +113,7 @@ describe("Hosts page filtering from table filters", () => { cy.dataCy(`${filterIconDataCy}-input-filter`).type( `${filterValue}{enter}`, - { scrollBehavior: false } + { scrollBehavior: false }, ); } cy.dataCy(`${filterIconDataCy}-wrapper`).should("not.exist"); @@ -138,6 +138,6 @@ describe("Hosts page filtering from table filters", () => { .type("{enter}"); } }); - } + }, ); }); diff --git a/cypress/integration/hosts/hosts_page_default.ts b/cypress/integration/hosts/hosts_page_default.ts index 3284cf0494..5cbc803c39 100644 --- a/cypress/integration/hosts/hosts_page_default.ts +++ b/cypress/integration/hosts/hosts_page_default.ts @@ -8,7 +8,7 @@ describe("Hosts Page Default", () => { it("Renders hosts table with hosts sorted by status by default", () => { cy.dataCy("leafygreen-table-row").each(($el, index) => - cy.wrap($el).contains(defaultHostsFirstPage[index]) + cy.wrap($el).contains(defaultHostsFirstPage[index]), ); }); diff --git a/cypress/integration/hosts/hosts_pagination.ts b/cypress/integration/hosts/hosts_pagination.ts index 787208cbb6..c99de9c254 100644 --- a/cypress/integration/hosts/hosts_pagination.ts +++ b/cypress/integration/hosts/hosts_pagination.ts @@ -5,7 +5,7 @@ describe("Hosts Page", () => { cy.visit("/hosts?limit=10&page=1"); cy.dataCy("leafygreen-table-row").each(($el, index) => - cy.wrap($el).contains(hostsSecondPageWithLimitOfTen[index]) + cy.wrap($el).contains(hostsSecondPageWithLimitOfTen[index]), ); cy.visit("/hosts?limit=20&page=0"); @@ -14,8 +14,8 @@ describe("Hosts Page", () => { cy .wrap($el) .contains( - [...defaultHostsFirstPage, ...hostsSecondPageWithLimitOfTen][index] - ) + [...defaultHostsFirstPage, ...hostsSecondPageWithLimitOfTen][index], + ), ); }); }); diff --git a/cypress/integration/hosts/hosts_sorting.ts b/cypress/integration/hosts/hosts_sorting.ts index 93c440a394..96e0bbc2e2 100644 --- a/cypress/integration/hosts/hosts_sorting.ts +++ b/cypress/integration/hosts/hosts_sorting.ts @@ -159,7 +159,7 @@ describe("Hosts page sorting", () => { cy.get(distroSortControl).click(); cy.location("search").should( "equal", - "?distroId=arfarf&page=0&sortBy=DISTRO&sortDir=ASC" + "?distroId=arfarf&page=0&sortBy=DISTRO&sortDir=ASC", ); }); it("Clicking a sort direction 3 times will set the page query param to 0, clear the direction & sortBy query param, and preserve the rest", () => { @@ -167,12 +167,12 @@ describe("Hosts page sorting", () => { cy.get(distroSortControl).click(); cy.location("search").should( "equal", - "?distroId=arfarf&page=0&sortBy=DISTRO&sortDir=ASC" + "?distroId=arfarf&page=0&sortBy=DISTRO&sortDir=ASC", ); cy.get(distroSortControl).click(); cy.location("search").should( "equal", - "?distroId=arfarf&page=0&sortBy=DISTRO&sortDir=DESC" + "?distroId=arfarf&page=0&sortBy=DISTRO&sortDir=DESC", ); cy.get(distroSortControl).click(); cy.location("search").should("equal", "?distroId=arfarf&page=0"); @@ -197,7 +197,7 @@ describe("Hosts page sorting", () => { it(`Sorts by ${sorterName} when sortBy = ${sortBy}`, () => { cy.visit(`${hostsRoute}?sortBy=${sortBy}&limit=10`); cy.dataCy("leafygreen-table-row").each(($el, index) => - cy.wrap($el).contains(expectedIds[index]) + cy.wrap($el).contains(expectedIds[index]), ); }); }); @@ -205,10 +205,10 @@ describe("Hosts page sorting", () => { sortDirectionTests.forEach(({ expectedIds, order, sortDir }) => { it(`Sorts in ${order} order when sortDir = ${sortDir}`, () => { cy.visit( - `${hostsRoute}?page=0&sortBy=CURRENT_TASK&sortDir=${sortDir}&limit=10` + `${hostsRoute}?page=0&sortBy=CURRENT_TASK&sortDir=${sortDir}&limit=10`, ); cy.dataCy("leafygreen-table-row").each(($el, index) => - cy.wrap($el).contains(expectedIds[index]) + cy.wrap($el).contains(expectedIds[index]), ); }); }); @@ -230,8 +230,8 @@ describe("Hosts page sorting", () => { "macos-1014-68.macstadium.build.10gen.c", "macos-1014-68.macstadium.build.10gen.cc", "ubuntu1804-ppc-3.pic.build.10gen", - ][index] - ) + ][index], + ), ); }); }); diff --git a/cypress/integration/hosts/select_hosts.ts b/cypress/integration/hosts/select_hosts.ts index 4a1d6a3959..8c5a65263e 100644 --- a/cypress/integration/hosts/select_hosts.ts +++ b/cypress/integration/hosts/select_hosts.ts @@ -19,17 +19,17 @@ describe("Select hosts in hosts page table", () => { cy.dataCy("update-status-button").should( "have.attr", "aria-disabled", - "true" + "true", ); cy.dataCy("restart-jasper-button").should( "have.attr", "aria-disabled", - "true" + "true", ); cy.dataCy("reprovision-button").should( "have.attr", "aria-disabled", - "true" + "true", ); }); @@ -38,17 +38,17 @@ describe("Select hosts in hosts page table", () => { cy.dataCy("update-status-button").should( "not.have.attr", "aria-disabled", - "true" + "true", ); cy.dataCy("restart-jasper-button").should( "not.have.attr", "aria-disabled", - "true" + "true", ); cy.dataCy("reprovision-button").should( "not.have.attr", "aria-disabled", - "true" + "true", ); }); @@ -57,7 +57,7 @@ describe("Select hosts in hosts page table", () => { cy.dataCy("restart-jasper-button").should( "not.have.attr", "aria-disabled", - "true" + "true", ); cy.dataCy("restart-jasper-button").should("be.visible").click(); cy.dataCy("restart-jasper-button-popover").should("be.visible"); @@ -70,7 +70,7 @@ describe("Select hosts in hosts page table", () => { cy.dataCy("reprovision-button").should( "not.have.attr", "aria-disabled", - "true" + "true", ); cy.dataCy("reprovision-button").should("be.visible").click(); cy.dataCy("reprovision-button-popover").should("be.visible"); diff --git a/cypress/integration/job_logs.ts b/cypress/integration/job_logs.ts index d7ebe7e4cb..1135fb9c54 100644 --- a/cypress/integration/job_logs.ts +++ b/cypress/integration/job_logs.ts @@ -21,7 +21,7 @@ describe("Job logs page", () => { .then((href) => { cy.wrap(href).should( "contain", - "/resmoke/7e208050e166b1a9025c817b67eee48d/all" + "/resmoke/7e208050e166b1a9025c817b67eee48d/all", ); }); }); @@ -35,7 +35,7 @@ describe("Invalid job logs page", () => { it("shows an error toast", () => { cy.validateToast( "error", - "There was an error retrieving logs for this build: Logkeeper returned HTTP status 404" + "There was an error retrieving logs for this build: Logkeeper returned HTTP status 404", ); }); }); diff --git a/cypress/integration/myPatches/my_patches.ts b/cypress/integration/myPatches/my_patches.ts index ce4806c2db..3b0520f3df 100644 --- a/cypress/integration/myPatches/my_patches.ts +++ b/cypress/integration/myPatches/my_patches.ts @@ -15,7 +15,7 @@ describe("My Patches Page", () => { it("Redirects user to user patches route from `/user/:id`", () => { cy.visit("user/chicken"); cy.location().should((loc) => - expect(loc.pathname).to.eq("/user/chicken/patches") + expect(loc.pathname).to.eq("/user/chicken/patches"), ); }); @@ -78,7 +78,7 @@ describe("My Patches Page", () => { .should("have.attr", "href") .and( "equals", - "/version/5ecedafb562343215a7ff297/tasks?statuses=success" + "/version/5ecedafb562343215a7ff297/tasks?statuses=success", ); }); @@ -124,14 +124,14 @@ describe("My Patches Page", () => { cy.getCookie("include-commit-queue-user-patches").should( "have.property", "value", - "false" + "false", ); cy.contains("Include Commit Queue").click(); cy.dataCy("commit-queue-checkbox").should("be.checked"); cy.getCookie("include-commit-queue-user-patches").should( "have.property", "value", - "true" + "true", ); }); }); @@ -151,7 +151,7 @@ describe("My Patches Page", () => { clickOnPageBtnAndAssertURLandTableResults( dataCyNextPage, secondPageDisplayNames, - 1 + 1, ); }); @@ -162,7 +162,7 @@ describe("My Patches Page", () => { clickOnPageBtnAndAssertURLandTableResults( dataCyPrevPage, firstPageDisplayNames, - 0 + 0, ); }); diff --git a/cypress/integration/myPatches/patchCard/dropdown_menu.ts b/cypress/integration/myPatches/patchCard/dropdown_menu.ts index baaa811733..4ea866cfb6 100644 --- a/cypress/integration/myPatches/patchCard/dropdown_menu.ts +++ b/cypress/integration/myPatches/patchCard/dropdown_menu.ts @@ -124,7 +124,7 @@ describe("Dropdown Menu of Patch Actions", () => { cy.getCookie(INCLUDE_HIDDEN_PATCHES).should( "have.property", "value", - "true" + "true", ); cy.location("search").should("contain", "hidden=true"); cy.get("@targetPatchCard") @@ -138,7 +138,7 @@ describe("Dropdown Menu of Patch Actions", () => { cy.getCookie(INCLUDE_HIDDEN_PATCHES).should( "have.property", "value", - "true" + "true", ); cy.location("search").should("not.contain", "hidden=true"); cy.get("@targetPatchCard") @@ -160,7 +160,7 @@ describe("Dropdown Menu of Patch Actions", () => { cy.getCookie(INCLUDE_HIDDEN_PATCHES).should( "have.property", "value", - "false" + "false", ); cy.location("search").should("contain", "hidden=false"); cy.get("@targetPatchCard").should("be.visible"); diff --git a/cypress/integration/nav_bar.ts b/cypress/integration/nav_bar.ts index 7206c95e0b..c450219200 100644 --- a/cypress/integration/nav_bar.ts +++ b/cypress/integration/nav_bar.ts @@ -22,7 +22,7 @@ describe("Nav Bar", () => { cy.dataCy("legacy-ui-link").should( "have.attr", "href", - LEGACY_URLS.version + LEGACY_URLS.version, ); }); it("Navigating to a different page should change the nav link to the legacy UI", () => { @@ -36,7 +36,7 @@ describe("Nav Bar", () => { cy.dataCy("legacy-ui-link").should( "have.attr", "href", - LEGACY_URLS.userPatches + LEGACY_URLS.userPatches, ); }); it("Visiting a page with no legacy equivalent should not display a nav link", () => { @@ -56,7 +56,7 @@ describe("Nav Bar", () => { cy.dataCy("auxiliary-dropdown-distro-settings").should( "have.attr", "href", - "/distro/localhost/settings/general" + "/distro/localhost/settings/general", ); }); it("Nav Dropdown should link to patches page of default project in SpruceConfig if cookie does not exist", () => { @@ -66,7 +66,7 @@ describe("Nav Bar", () => { cy.dataCy("auxiliary-dropdown-project-patches").should( "have.attr", "href", - "/project/evergreen/patches" + "/project/evergreen/patches", ); cy.dataCy("auxiliary-dropdown-project-patches").click(); cy.location("pathname").should("eq", "/project/evergreen/patches"); @@ -79,13 +79,13 @@ describe("Nav Bar", () => { cy.dataCy("project-health-link").should( "have.attr", "href", - "/commits/evergreen" + "/commits/evergreen", ); cy.dataCy("auxiliary-dropdown-link").click(); cy.dataCy("auxiliary-dropdown-project-settings").should( "have.attr", "href", - "/project/evergreen/settings" + "/project/evergreen/settings", ); cy.getCookie(projectCookie).should("have.property", "value", "evergreen"); }); @@ -97,13 +97,13 @@ describe("Nav Bar", () => { cy.dataCy("project-health-link").should( "have.attr", "href", - "/commits/spruce" + "/commits/spruce", ); cy.dataCy("auxiliary-dropdown-link").click(); cy.dataCy("auxiliary-dropdown-project-patches").should( "have.attr", "href", - "/project/spruce/patches" + "/project/spruce/patches", ); cy.getCookie(projectCookie).should("have.property", "value", "spruce"); }); diff --git a/cypress/integration/page_tabs.ts b/cypress/integration/page_tabs.ts index 9c9764144d..e2c9e6d5f0 100644 --- a/cypress/integration/page_tabs.ts +++ b/cypress/integration/page_tabs.ts @@ -8,7 +8,7 @@ describe("Tabs", () => { locationPathEquals(patches.tasks.route); cy.location("search").should( "contain", - "sorts=STATUS%3AASC%3BBASE_STATUS%3ADESC" + "sorts=STATUS%3AASC%3BBASE_STATUS%3ADESC", ); }); @@ -29,14 +29,14 @@ describe("Tabs", () => { locationPathEquals(patches.changes.route); cy.location("search").should( "not.contain", - "sorts=STATUS%3AASC%3BBASE_STATUS%3ADESC" + "sorts=STATUS%3AASC%3BBASE_STATUS%3ADESC", ); cy.dataCy("task-tab").first().click(); locationPathEquals(patches.tasks.route); cy.location("search").should( "contain", - "sorts=STATUS%3AASC%3BBASE_STATUS%3ADESC" + "sorts=STATUS%3AASC%3BBASE_STATUS%3ADESC", ); }); @@ -44,14 +44,14 @@ describe("Tabs", () => { cy.visit(patchRoute); cy.location("search").should( "contain", - "sorts=STATUS%3AASC%3BBASE_STATUS%3ADESC" + "sorts=STATUS%3AASC%3BBASE_STATUS%3ADESC", ); cy.get(`button[data-cy='${patches.changes.btn}']`).click(); locationPathEquals(patches.changes.route); cy.location("search").should( "contain", - "sorts=STATUS%3AASC%3BBASE_STATUS%3ADESC" + "sorts=STATUS%3AASC%3BBASE_STATUS%3ADESC", ); }); diff --git a/cypress/integration/preferences/notifications.ts b/cypress/integration/preferences/notifications.ts index 2566007409..fea618ea9b 100644 --- a/cypress/integration/preferences/notifications.ts +++ b/cypress/integration/preferences/notifications.ts @@ -6,14 +6,14 @@ describe("global subscription settings", () => { cy.dataCy("save-profile-changes-button").should( "have.attr", "aria-disabled", - "true" + "true", ); cy.dataCy("slack-member-id-field").clear(); cy.dataCy("slack-member-id-field").type("12345"); cy.dataCy("save-profile-changes-button").should( "not.have.attr", "aria-disabled", - "true" + "true", ); }); it("saving changes to a field should work", () => { @@ -71,7 +71,7 @@ describe("user subscriptions table", () => { cy.dataCy("delete-some-button").should( "have.attr", "aria-disabled", - "true" + "true", ); }); diff --git a/cypress/integration/preferences/public_key_management.ts b/cypress/integration/preferences/public_key_management.ts index d473619086..66baf95c8c 100644 --- a/cypress/integration/preferences/public_key_management.ts +++ b/cypress/integration/preferences/public_key_management.ts @@ -6,7 +6,7 @@ describe("Public Key Management Page", () => { describe("Public keys list", () => { it("Displays the user's public keys", () => { cy.dataCy("table-key-name").each(($el, index) => - cy.wrap($el).contains([keyName1, keyName2][index]) + cy.wrap($el).contains([keyName1, keyName2][index]), ); }); it("Removes a public key from the table after deletion", () => { @@ -31,7 +31,7 @@ describe("Public Key Management Page", () => { }); it("Displays errors when the modal opens", () => { cy.dataCy("error-message").each(($el, index) => - cy.wrap($el).contains([err1, err2][index]) + cy.wrap($el).contains([err1, err2][index]), ); }); diff --git a/cypress/integration/projectHealth/commits.ts b/cypress/integration/projectHealth/commits.ts index cc7c9c8309..a3d8326fd7 100644 --- a/cypress/integration/projectHealth/commits.ts +++ b/cypress/integration/projectHealth/commits.ts @@ -12,7 +12,7 @@ describe("commits page", () => { cy.dataCy("waterfall-task-status-icon").should( "have.attr", "aria-label", - "failed icon" + "failed icon", ); cy.dataCy("grouped-task-status-badge").should("not.exist"); }); @@ -63,7 +63,7 @@ describe("commits page", () => { cy.dataCy("commit-chart-container").should( "have.attr", "data-type", - "absolute" + "absolute", ); cy.getInputByLabel("Percentage").click({ force: true }); cy.getInputByLabel("Absolute Number").should("not.be.checked"); @@ -71,7 +71,7 @@ describe("commits page", () => { cy.dataCy("commit-chart-container").should( "have.attr", "data-type", - "percentage" + "percentage", ); cy.location("search").should("contain", "chartType=percentage"); cy.getInputByLabel("Absolute Number").click({ force: true }); @@ -80,7 +80,7 @@ describe("commits page", () => { cy.dataCy("commit-chart-container").should( "have.attr", "data-type", - "absolute" + "absolute", ); cy.location("search").should("contain", "chartType=absolute"); }); @@ -89,13 +89,13 @@ describe("commits page", () => { cy.dataCy("next-page-button").should( "not.have.attr", "aria-disabled", - "true" + "true", ); cy.dataCy("next-page-button").click(); cy.dataCy("prev-page-button").should( "not.have.attr", "aria-disabled", - "true" + "true", ); cy.dataCy("prev-page-button").click(); cy.dataCy("prev-page-button").should("have.attr", "aria-disabled", "true"); @@ -123,13 +123,13 @@ describe("commits page", () => { cy.dataCy("inactive-commits-tooltip").should("exist"); cy.dataCy("inactive-commits-tooltip").should( "contain.text", - "1 Inactive Commit" + "1 Inactive Commit", ); cy.dataCy("inactive-commits-tooltip").should("contain.text", "e695f65"); cy.contains("e695f65").should( "have.attr", "href", - "/version/spruce_e695f654c8b4b959d3e12e71696c3e318bcd4c33/tasks" + "/version/spruce_e695f654c8b4b959d3e12e71696c3e318bcd4c33/tasks", ); }); }); @@ -143,18 +143,18 @@ describe("commits page", () => { cy.dataCy("waterfall-task-status-icon").should( "have.attr", "aria-label", - "failed icon" + "failed icon", ); cy.dataCy("waterfall-task-status-icon").first().trigger("mouseover"); cy.dataCy("waterfall-task-status-icon-tooltip").should("exist"); cy.dataCy("waterfall-task-status-icon-tooltip").should("be.visible"); cy.dataCy("waterfall-task-status-icon-tooltip").should( "contain.text", - "check_codegen" + "check_codegen", ); cy.dataCy("waterfall-task-status-icon-tooltip").should( "contain.text", - "JustAFakeTestInALonelyWorld" + "JustAFakeTestInALonelyWorld", ); }); it("clicking on a task icon should direct you to the task page", () => { @@ -186,7 +186,7 @@ describe("commits page", () => { cy.dataCy("grouped-task-status-badge-tooltip").should("be.visible"); cy.dataCy("grouped-task-status-badge-tooltip").should( "contain.text", - "1 Succeeded" + "1 Succeeded", ); }); it("should direct you to the version page with the build variant and task status filters applied", () => { @@ -224,13 +224,13 @@ describe("commits page", () => { cy.get("[data-selected='true']").should("be.visible"); cy.get("[data-selected='true']").should( "contain.text", - revision.substring(0, 7) + revision.substring(0, 7), ); }); it("should clear any applied filters and skip numbers", () => { cy.visit( - "/commits/spruce?buildVariants=ubuntu&skipOrderNumber=1231&taskNames=codegen&view=FAILED" + "/commits/spruce?buildVariants=ubuntu&skipOrderNumber=1231&taskNames=codegen&view=FAILED", ); searchCommit(revision); cy.location("search").should("not.contain", "buildVariants"); diff --git a/cypress/integration/projectHealth/filtering.ts b/cypress/integration/projectHealth/filtering.ts index d43128f1ae..8582d70130 100644 --- a/cypress/integration/projectHealth/filtering.ts +++ b/cypress/integration/projectHealth/filtering.ts @@ -48,7 +48,7 @@ describe("filtering", () => { cy.dataCy("grouped-task-status-badge").should("have.length", 9); cy.dataCy("grouped-task-status-badge").should( "contain.text", - "Succeeded" + "Succeeded", ); cy.dataCy("waterfall-task-status-icon").should("not.exist"); }); @@ -62,7 +62,7 @@ describe("filtering", () => { cy.dataCy("waterfall-task-status-icon").should( "have.attr", "aria-label", - "failed icon" + "failed icon", ); }); it("applying a task filter should show all task icons instead of groupings", () => { diff --git a/cypress/integration/projectHealth/project_banners.ts b/cypress/integration/projectHealth/project_banners.ts index aa84717cb8..5103f50f4c 100644 --- a/cypress/integration/projectHealth/project_banners.ts +++ b/cypress/integration/projectHealth/project_banners.ts @@ -12,12 +12,12 @@ describe("project banners", () => { cy.dataCy("repotracker-error-trigger").click(); cy.dataCy("repotracker-error-modal").should("be.visible"); cy.getInputByLabel("Base Revision").type( - "7ad0f0571691fa5063b757762a5b103999290fa8" + "7ad0f0571691fa5063b757762a5b103999290fa8", ); cy.contains("button", "Confirm").should( "have.attr", "aria-disabled", - "false" + "false", ); cy.contains("button", "Confirm").click(); cy.validateToast("success", "Successfully updated merge base revision"); diff --git a/cypress/integration/projectHealth/task_history.ts b/cypress/integration/projectHealth/task_history.ts index 2554b086d5..631751acde 100644 --- a/cypress/integration/projectHealth/task_history.ts +++ b/cypress/integration/projectHealth/task_history.ts @@ -4,7 +4,7 @@ describe("task history", () => { cy.dataCy("loading-cell").should("have.length", 0); cy.validateToast( "error", - "There was an error loading the task history: Could not find project with id: bogus-project" + "There was an error loading the task history: Could not find project with id: bogus-project", ); }); @@ -38,14 +38,14 @@ describe("task history", () => { cy.dataCy("task-history-tests-btn").click(); cy.location("pathname").should( "contain", - `/task-history/spruce/check_codegen` + `/task-history/spruce/check_codegen`, ); cy.dataCy("filter-badge").should("exist"); cy.dataCy("filter-badge").should("contain.text", "JustAFake"); }); it("hovering over a failing task should show test results", () => { cy.visit( - "/task-history/spruce/check_codegen?failed=JustAFakeTestInALonelyWorld&selectedCommit=1236" + "/task-history/spruce/check_codegen?failed=JustAFakeTestInALonelyWorld&selectedCommit=1236", ); cy.dataCy("history-table-icon").get("[data-status=failed]").should("exist"); cy.dataCy("history-table-icon") diff --git a/cypress/integration/projectHealth/variant_history.ts b/cypress/integration/projectHealth/variant_history.ts index ce131c013a..aebc326af6 100644 --- a/cypress/integration/projectHealth/variant_history.ts +++ b/cypress/integration/projectHealth/variant_history.ts @@ -4,7 +4,7 @@ describe("variant history", () => { cy.dataCy("loading-cell").should("have.length", 0); cy.validateToast( "error", - "There was an error loading the variant history: Could not find project with id: bogus-project" + "There was an error loading the variant history: Could not find project with id: bogus-project", ); }); @@ -32,7 +32,7 @@ describe("variant history", () => { cy.dataCy("header-cell").should("have.length", 4); cy.dataCy("prev-page-button").click(); cy.dataCy("header-cell").should("have.length", 4); - } + }, ); it("should be able expand and collapse inactive commits", () => { cy.visit("/variant-history/spruce/ubuntu1604?selectedCommit=1238"); @@ -68,7 +68,7 @@ describe("variant history", () => { }); it("hovering over a failing task should show test results", () => { cy.visit( - "/variant-history/spruce/ubuntu1604?failed=JustAFakeTestInALonelyWorld&selectedCommit=1236" + "/variant-history/spruce/ubuntu1604?failed=JustAFakeTestInALonelyWorld&selectedCommit=1236", ); cy.dataCy("history-table-icon") .get("[data-status=failed]") diff --git a/cypress/integration/projectSettings/access.ts b/cypress/integration/projectSettings/access.ts index df7df77452..506c04744c 100644 --- a/cypress/integration/projectSettings/access.ts +++ b/cypress/integration/projectSettings/access.ts @@ -57,7 +57,7 @@ xdescribe("Access page", () => { clickSave(); cy.validateToast( "error", - "There was an error saving the project: error updating project admin roles: no admin role for project 'spruce' found" + "There was an error saving the project: error updating project admin roles: no admin role for project 'spruce' found", ); }); }); diff --git a/cypress/integration/projectSettings/admin_actions.ts b/cypress/integration/projectSettings/admin_actions.ts index 229cdb049b..815687959d 100644 --- a/cypress/integration/projectSettings/admin_actions.ts +++ b/cypress/integration/projectSettings/admin_actions.ts @@ -60,7 +60,7 @@ describe("Creating a new project and deleting it", () => { cy.reload(); cy.validateToast( "error", - "Could not find project with identifier: my-new-project" + "Could not find project with identifier: my-new-project", ); }); }); diff --git a/cypress/integration/projectSettings/attaching_to_repo.ts b/cypress/integration/projectSettings/attaching_to_repo.ts index dd8d45f67d..da4f61a5df 100644 --- a/cypress/integration/projectSettings/attaching_to_repo.ts +++ b/cypress/integration/projectSettings/attaching_to_repo.ts @@ -14,7 +14,7 @@ describe("Attaching Spruce to a repo", () => { cy.dataCy("attach-repo-button").should( "have.attr", "aria-disabled", - "true" + "true", ); clickSave(); cy.validateToast("success", "Successfully updated project"); diff --git a/cypress/integration/projectSettings/constants.ts b/cypress/integration/projectSettings/constants.ts index 4d65f0e812..196d7ba670 100644 --- a/cypress/integration/projectSettings/constants.ts +++ b/cypress/integration/projectSettings/constants.ts @@ -37,6 +37,6 @@ export const saveButtonEnabled = (isEnabled: boolean = true) => { cy.dataCy("save-settings-button").should( isEnabled ? "not.have.attr" : "have.attr", "aria-disabled", - "true" + "true", ); }; diff --git a/cypress/integration/projectSettings/defaulting_to_repo.ts b/cypress/integration/projectSettings/defaulting_to_repo.ts index 0583636ed6..1e770489c2 100644 --- a/cypress/integration/projectSettings/defaulting_to_repo.ts +++ b/cypress/integration/projectSettings/defaulting_to_repo.ts @@ -122,7 +122,7 @@ describe("Project Settings when defaulting to repo", () => { cy.contains("label", "Override Repo Patch Definition").click(); cy.dataCy("error-banner") .contains( - "A GitHub Patch Definition must be specified for this feature to run." + "A GitHub Patch Definition must be specified for this feature to run.", ) .should("exist"); cy.contains("button", "Add Patch Definition").click(); @@ -152,7 +152,7 @@ describe("Project Settings when defaulting to repo", () => { cy.dataCy("warning-banner") .contains( - "This feature will only run if a Commit Check Definition is defined in the project or repo." + "This feature will only run if a Commit Check Definition is defined in the project or repo.", ) .should("exist"); }); @@ -165,7 +165,7 @@ describe("Project Settings when defaulting to repo", () => { it("Displays the repo's merge method as its default", () => { cy.get("button[name=merge-method-select]").should( "have.text", - "Default to Repo (squash)" + "Default to Repo (squash)", ); }); @@ -200,7 +200,7 @@ describe("Project Settings when defaulting to repo", () => { clickSave(); cy.validateToast( "error", - "There was an error saving the project: GitHub checks cannot be enabled without aliases" + "There was an error saving the project: GitHub checks cannot be enabled without aliases", ); }); @@ -238,7 +238,7 @@ describe("Project Settings when defaulting to repo", () => { it("Defaults to repo patch aliases", () => { cy.getInputByLabel("Default to Repo Patch Aliases").should( "have.attr", - "checked" + "checked", ); }); @@ -250,7 +250,7 @@ describe("Project Settings when defaulting to repo", () => { cy.getInputByLabel("Override Repo Patch Aliases").should( "have.attr", "aria-checked", - "true" + "true", ); saveButtonEnabled(false); cy.dataCy("add-button") @@ -294,7 +294,7 @@ describe("Project Settings when defaulting to repo", () => { cy.dataCy("attached-repo-link").click(); cy.location("pathname").should( "equal", - `/${getVirtualWorkstationRoute(repo)}` + `/${getVirtualWorkstationRoute(repo)}`, ); cy.contains("button", "Add Command").click(); cy.dataCy("command-input").type("a repo command"); diff --git a/cypress/integration/projectSettings/not_defaulting_to_repo.ts b/cypress/integration/projectSettings/not_defaulting_to_repo.ts index b2e465ecb9..765bfec3df 100644 --- a/cypress/integration/projectSettings/not_defaulting_to_repo.ts +++ b/cypress/integration/projectSettings/not_defaulting_to_repo.ts @@ -73,7 +73,7 @@ describe("Project Settings when not defaulting to repo", () => { cy.dataCy("var-name-input").first().type("sample_name"); cy.dataCy("var-value-input").first().type("sample_value_2"); cy.contains("Value already appears in project variables.").as( - "errorMessage" + "errorMessage", ); saveButtonEnabled(false); // Undo variable duplication diff --git a/cypress/integration/projectSettings/notifications.ts b/cypress/integration/projectSettings/notifications.ts index cd02e23dbc..5643aef6c2 100644 --- a/cypress/integration/projectSettings/notifications.ts +++ b/cypress/integration/projectSettings/notifications.ts @@ -47,7 +47,7 @@ describe("Notifications", () => { cy.selectLGOption("Notification Method", "Comment on a JIRA issue"); cy.getInputByLabel("JIRA Issue").type("JIRA-123"); cy.contains("Subscription type not allowed for tasks in a project.").should( - "be.visible" + "be.visible", ); cy.dataCy("save-settings-button").scrollIntoView(); saveButtonEnabled(false); diff --git a/cypress/integration/projectSettings/plugins.ts b/cypress/integration/projectSettings/plugins.ts index ba5ae344a8..3ebee64567 100644 --- a/cypress/integration/projectSettings/plugins.ts +++ b/cypress/integration/projectSettings/plugins.ts @@ -21,7 +21,7 @@ describe("Plugins", () => { cy.dataCy("external-link").should( "have.attr", "href", - "https://example.com/5ecedafb562343215a7ff297" + "https://example.com/5ecedafb562343215a7ff297", ); // Unset the external link diff --git a/cypress/integration/projectSettings/repo_settings.ts b/cypress/integration/projectSettings/repo_settings.ts index 7bb2e5b958..ca40200684 100644 --- a/cypress/integration/projectSettings/repo_settings.ts +++ b/cypress/integration/projectSettings/repo_settings.ts @@ -53,7 +53,7 @@ describe("Repo Settings", () => { .click(); cy.dataCy("error-banner") .contains( - "A Commit Check Definition must be specified for this feature to run." + "A Commit Check Definition must be specified for this feature to run.", ) .as("errorBanner"); cy.get("@errorBanner").should("be.visible"); @@ -71,7 +71,7 @@ describe("Repo Settings", () => { }); it("Saving a patch defintion should hide the error banner, success toast and displays disable patch definitions for the repo", () => { cy.contains( - "A GitHub Patch Definition must be specified for this feature to run." + "A GitHub Patch Definition must be specified for this feature to run.", ).as("errorBanner"); cy.get("@errorBanner").should("be.visible"); cy.contains("button", "Add Patch Definition").click(); @@ -93,7 +93,7 @@ describe("Repo Settings", () => { cy.dataCy("task-tags-input").should("have.value", "ttag"); cy.dataCy("task-tags-input").should("be.disabled"); cy.contains( - "A GitHub Patch Definition must be specified for this feature to run." + "A GitHub Patch Definition must be specified for this feature to run.", ).should("not.exist"); }); }); @@ -116,7 +116,7 @@ describe("Repo Settings", () => { cy.contains("Commit Queue Patch Definitions").scrollIntoView(); cy.dataCy("error-banner") .contains( - "A Commit Queue Patch Definition must be specified for this feature to run." + "A Commit Queue Patch Definition must be specified for this feature to run.", ) .should("be.visible"); }); @@ -165,7 +165,7 @@ describe("Repo Settings", () => { cy.dataCy("cq-message-input").should( "have.attr", "placeholder", - "Repo message wohoo! (Default from repo)" + "Repo message wohoo! (Default from repo)", ); }); }); @@ -218,7 +218,7 @@ describe("Repo Settings", () => { cy.dataCy("variant-regex-input").type(".*"); cy.dataCy("task-regex-input").type(".*"); cy.getInputByLabel("Add to GitHub Trigger Alias").as( - "triggerAliasCheckbox" + "triggerAliasCheckbox", ); cy.get("@triggerAliasCheckbox").should("not.be.checked"); cy.get("@triggerAliasCheckbox").check({ force: true }); @@ -231,14 +231,14 @@ describe("Repo Settings", () => { cy.getInputByLabel("Wait on").should( "have.attr", "aria-invalid", - "false" + "false", ); saveButtonEnabled(true); cy.selectLGOption("Wait on", "Select event…"); cy.getInputByLabel("Wait on").should( "have.attr", "aria-invalid", - "false" + "false", ); saveButtonEnabled(false); // Verify information on Github/Commit Queue page diff --git a/cypress/integration/shortcuts/tabs.ts b/cypress/integration/shortcuts/tabs.ts index 7c72ddede1..eb0a54ea0a 100644 --- a/cypress/integration/shortcuts/tabs.ts +++ b/cypress/integration/shortcuts/tabs.ts @@ -43,12 +43,12 @@ describe("Tab shortcut", () => { it("toggle through tabs with 'j' and 'k' on the task page", () => { cy.visit( - "task/mci_ubuntu1604_display_asdf_patch_a1d2c8f70bf5c543de8b9641ac1ec08def1ddb26_5f74d99ab2373627c047c5e5_20_09_30_19_16_47/" + "task/mci_ubuntu1604_display_asdf_patch_a1d2c8f70bf5c543de8b9641ac1ec08def1ddb26_5f74d99ab2373627c047c5e5_20_09_30_19_16_47/", ); cy.dataCy("task-execution-tab").should( "have.attr", "aria-selected", - "true" + "true", ); cy.get("body").type("j"); cy.dataCy("task-files-tab").should("have.attr", "aria-selected", "true"); @@ -58,7 +58,7 @@ describe("Tab shortcut", () => { cy.dataCy("task-execution-tab").should( "have.attr", "aria-selected", - "true" + "true", ); cy.get("body").type("j"); cy.dataCy("task-files-tab").should("have.attr", "aria-selected", "true"); @@ -67,7 +67,7 @@ describe("Tab shortcut", () => { cy.dataCy("task-execution-tab").should( "have.attr", "aria-selected", - "true" + "true", ); cy.get("body").type("k"); cy.dataCy("task-tests-tab").should("have.attr", "aria-selected", "true"); diff --git a/cypress/integration/spawn/host.ts b/cypress/integration/spawn/host.ts index 94aaeaac21..b2a1288172 100644 --- a/cypress/integration/spawn/host.ts +++ b/cypress/integration/spawn/host.ts @@ -61,11 +61,11 @@ describe("Navigating to Spawn Host page", () => { it("Clicking on the host column header should sort spawn hosts by ascending order, then descending, then remove sort", () => { cy.get("button[aria-label='Sort by Host']").as("hostSortControl").click(); cy.dataCy("leafygreen-table-row").each(($el, index) => - cy.wrap($el).contains(ascendingSortSpawnHostOrderByHostId[index]) + cy.wrap($el).contains(ascendingSortSpawnHostOrderByHostId[index]), ); cy.get("@hostSortControl").click(); cy.dataCy("leafygreen-table-row").each(($el, index) => - cy.wrap($el).contains(descendingSortSpawnHostOrderByHostId[index]) + cy.wrap($el).contains(descendingSortSpawnHostOrderByHostId[index]), ); cy.get("@hostSortControl").click(); cy.dataCy("leafygreen-table-row").should("have.length", 2); @@ -76,11 +76,11 @@ describe("Navigating to Spawn Host page", () => { .as("expiresInSortControl") .click(); cy.dataCy("leafygreen-table-row").each(($el, index) => - cy.wrap($el).contains(ascendingSortSpawnHostOrderByExpiration[index]) + cy.wrap($el).contains(ascendingSortSpawnHostOrderByExpiration[index]), ); cy.get("@expiresInSortControl").click(); cy.dataCy("leafygreen-table-row").each(($el, index) => - cy.wrap($el).contains(descendingSortSpawnHostOrderByExpiration[index]) + cy.wrap($el).contains(descendingSortSpawnHostOrderByExpiration[index]), ); cy.get("@expiresInSortControl").click(); cy.dataCy("leafygreen-table-row").should("have.length", 2); @@ -98,12 +98,12 @@ describe("Navigating to Spawn Host page", () => { cy.dataCy("never-expire-checkbox").should( "have.attr", "aria-checked", - "false" + "false", ); cy.dataCy("never-expire-checkbox").should( "have.css", "pointer-events", - "none" + "none", ); }); @@ -131,12 +131,12 @@ describe("Navigating to Spawn Host page", () => { }); it("Visiting the spawn host page with a taskId url param should render additional options at the bottom of the modal.", () => { cy.visit( - `spawn/host?spawnHost=True&distroId=rhel71-power8-large&taskId=${hostTaskId}` + `spawn/host?spawnHost=True&distroId=rhel71-power8-large&taskId=${hostTaskId}`, ); cy.dataCy("spawn-host-modal").should("contain.text", label1); cy.dataCy("spawn-host-modal").should( "contain.text", - "Load data for dist on ubuntu1604" + "Load data for dist on ubuntu1604", ); cy.dataCy("spawn-host-modal").should("contain.text", label2); cy.dataCy("spawn-host-modal").should("contain.text", label3); @@ -144,7 +144,7 @@ describe("Navigating to Spawn Host page", () => { it("Unchecking 'Load data for dist' hides nested checkbox selections and checking shows them.", () => { cy.visit( - `spawn/host?spawnHost=True&distroId=rhel71-power8-large&taskId=${hostTaskId}` + `spawn/host?spawnHost=True&distroId=rhel71-power8-large&taskId=${hostTaskId}`, ); cy.dataCy("spawn-host-modal").should("be.visible"); cy.dataCy("load-data-checkbox").should("be.checked"); @@ -161,14 +161,14 @@ describe("Navigating to Spawn Host page", () => { it("Visiting the spawn host page with a task and distro supplied in the url should populate the distro input", () => { cy.visit( - `/spawn/host?spawnHost=True&distroId=${distroId}&taskId=${hostTaskId}` + `/spawn/host?spawnHost=True&distroId=${distroId}&taskId=${hostTaskId}`, ); cy.dataCy("spawn-host-modal").should("be.visible"); cy.dataCy("distro-input").dataCy("dropdown-value").contains(distroId); }); it("The virtual workstation dropdown should filter any volumes that aren't a home volume", () => { cy.visit( - `/spawn/host?spawnHost=True&distroId=${distroId}&taskId=${hostTaskId}` + `/spawn/host?spawnHost=True&distroId=${distroId}&taskId=${hostTaskId}`, ); cy.dataCy("distro-input").click(); cy.dataCy("distro-option-ubuntu1804-workstation") @@ -179,7 +179,7 @@ describe("Navigating to Spawn Host page", () => { it("Clicking 'Add new key' hides the key name dropdown and shows the key value text area", () => { cy.visit( - `/spawn/host?spawnHost=True&distroId=${distroId}&taskId=${hostTaskId}` + `/spawn/host?spawnHost=True&distroId=${distroId}&taskId=${hostTaskId}`, ); cy.dataCy("key-select").should("be.visible"); cy.dataCy("key-value-text-area").should("not.exist"); @@ -190,7 +190,7 @@ describe("Navigating to Spawn Host page", () => { it("Checking 'Run Userdata script on start' shows the user data script text area", () => { cy.visit( - `/spawn/host?spawnHost=True&distroId=${distroId}&taskId=${hostTaskId}` + `/spawn/host?spawnHost=True&distroId=${distroId}&taskId=${hostTaskId}`, ); cy.dataCy("run-user-data-script-text-area").should("not.exist"); cy.contains("Run Userdata script on start").click(); @@ -199,39 +199,39 @@ describe("Navigating to Spawn Host page", () => { it("Checking 'Define setup script...' shows the setup script text area", () => { cy.visit( - `/spawn/host?spawnHost=True&distroId=${distroId}&taskId=${hostTaskId}` + `/spawn/host?spawnHost=True&distroId=${distroId}&taskId=${hostTaskId}`, ); cy.dataCy("setup-script-text-area").should("not.exist"); cy.contains( - "Define setup script to run after host is configured (i.e. task data and artifacts are loaded" + "Define setup script to run after host is configured (i.e. task data and artifacts are loaded", ).click(); cy.dataCy("setup-script-text-area").should("be.visible"); }); it("Conditionally disables setup script and project setup script checkboxes based on the other's value", () => { cy.visit( - `/spawn/host?spawnHost=True&distroId=${distroId}&taskId=${hostTaskId}` + `/spawn/host?spawnHost=True&distroId=${distroId}&taskId=${hostTaskId}`, ); // Checking setup script should disable project setup script. cy.dataCy("setup-script-checkbox").check({ force: true }); cy.dataCy("project-setup-script-checkbox").should( "have.attr", "aria-disabled", - "true" + "true", ); // Unchecking setup script should reenable project setup script. cy.dataCy("setup-script-checkbox").uncheck({ force: true }); cy.dataCy("project-setup-script-checkbox").should( "have.attr", "aria-disabled", - "false" + "false", ); // Checking project setup script should disable setup script. cy.dataCy("project-setup-script-checkbox").check({ force: true }); cy.dataCy("setup-script-checkbox").should( "have.attr", "aria-disabled", - "true" + "true", ); }); const label1 = "Use project-specific setup script defined at /path"; diff --git a/cypress/integration/spawn/volume.ts b/cypress/integration/spawn/volume.ts index f117857230..d382817fb2 100644 --- a/cypress/integration/spawn/volume.ts +++ b/cypress/integration/spawn/volume.ts @@ -9,7 +9,7 @@ describe("Spawn volume page", () => { it("The table initially displays volumes with status ascending.", () => { cy.dataCy("leafygreen-table-row").each(($el, index) => - cy.contains(expectedVolNames[index]) + cy.contains(expectedVolNames[index]), ); }); @@ -22,13 +22,13 @@ describe("Spawn volume page", () => { it("Should render migrating volumes with a different badge and disable action buttons", () => { cy.contains( '[data-cy="leafygreen-table-row"]', - "vol-0ae8720b445b771b6" + "vol-0ae8720b445b771b6", ).within(() => { cy.dataCy("volume-status-badge").contains("Migrating"); cy.get("button[aria-label!='Expand row']").should( "have.attr", "aria-disabled", - "true" + "true", ); }); }); @@ -47,7 +47,7 @@ describe("Spawn volume page", () => { .find("button[aria-label='Collapse row']") .click(); cy.dataCy("spawn-volume-card-vol-0ea662ac92f611ed4").should( - "not.be.visible" + "not.be.visible", ); cy.contains('[data-cy="leafygreen-table-row"]', "vol-0ea662ac92f611ed4") .find("button[aria-label='Expand row']") @@ -58,7 +58,7 @@ describe("Spawn volume page", () => { it("Clicking the trash can should remove the volume from the table and update free/mounted volumes badges.", () => { cy.contains( '[data-cy="leafygreen-table-row"]', - "vol-0c66e16459646704d" + "vol-0c66e16459646704d", ).should("exist"); cy.dataCy("trash-vol-0c66e16459646704d").click(); cy.dataCy("delete-volume-popconfirm").should("be.visible"); @@ -71,7 +71,7 @@ describe("Spawn volume page", () => { }); cy.contains( '[data-cy="leafygreen-table-row"]', - "vol-0c66e16459646704d" + "vol-0c66e16459646704d", ).should("not.exist"); cy.dataCy("mounted-badge").contains("9 Mounted"); cy.dataCy("free-badge").contains("3 Free"); @@ -79,20 +79,20 @@ describe("Spawn volume page", () => { it("Clicking the trash can for a mounted volume should show an additional confirmation checkbox which enables the submit button when checked.", () => { cy.dataCy( - "trash-e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" + "trash-e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", ).click(); cy.dataCy("delete-volume-popconfirm").should("be.visible"); cy.dataCy("delete-volume-popconfirm").within(($el) => { cy.wrap($el) .getInputByLabel( - "I understand this volume is currently mounted to a host." + "I understand this volume is currently mounted to a host.", ) .should("not.be.checked"); cy.wrap($el).contains("Yes"); cy.wrap($el).contains("Yes").should("have.attr", "aria-disabled", "true"); cy.wrap($el) .getInputByLabel( - "I understand this volume is currently mounted to a host." + "I understand this volume is currently mounted to a host.", ) .check({ force: true }); cy.wrap($el) @@ -106,7 +106,7 @@ describe("Spawn volume page", () => { it("Clicking on unmount should result in a success toast appearing.", () => { cy.dataCy( - "detach-btn-e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b857" + "detach-btn-e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b857", ).click(); cy.contains("button", "Yes").click(); cy.validateToast("success"); @@ -116,7 +116,7 @@ describe("Spawn volume page", () => { cy.dataCy("spawn-volume-btn").should( "not.have.attr", "aria-disabled", - "true" + "true", ); cy.dataCy("spawn-volume-btn").click(); cy.dataCy("spawn-volume-modal").should("be.visible"); @@ -130,7 +130,7 @@ describe("Spawn volume page", () => { cy.contains("button", "Cancel").should( "not.have.attr", "aria-disabled", - "true" + "true", ); cy.contains("button", "Cancel").click({ force: true }); }); @@ -146,19 +146,19 @@ describe("Spawn volume page", () => { }); it("Clicking on 'Edit' should open the Edit Volume Modal", () => { cy.dataCy( - "edit-btn-e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b858" + "edit-btn-e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b858", ).click(); cy.dataCy("update-volume-modal").should("be.visible"); }); it("Volume name & expiration inputs should be populated with the volume display name & expiration on initial render", () => { cy.dataCy( - "edit-btn-e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b858" + "edit-btn-e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b858", ).click(); cy.dataCy("update-volume-modal").should("be.visible"); cy.dataCy("volume-name-input").should( "have.value", - "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b858" + "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b858", ); cy.dataCy("date-picker").should("have.value", "2020-06-06"); cy.dataCy("time-picker").should("have.value", "15:48:18"); // Defaults to UTC @@ -166,7 +166,7 @@ describe("Spawn volume page", () => { it("Reopening the edit volume modal should reset form input fields.", () => { cy.dataCy( - "edit-btn-e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b858" + "edit-btn-e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b858", ).click(); cy.dataCy("update-volume-modal").should("be.visible"); cy.dataCy("volume-name-input").type("Hello, World"); @@ -174,61 +174,61 @@ describe("Spawn volume page", () => { cy.contains("button", "Cancel").click(); }); cy.dataCy( - "edit-btn-e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b858" + "edit-btn-e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b858", ).click(); cy.dataCy("volume-name-input").should( "have.value", - "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b858" + "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b858", ); }); it("Submit button should be enabled when the volume details input value differs from what already exists.", () => { cy.dataCy( - "edit-btn-e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b858" + "edit-btn-e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b858", ).click(); cy.dataCy("update-volume-modal").should("be.visible"); cy.contains("button", "Save").should( "have.attr", "aria-disabled", - "true" + "true", ); // type a new name cy.dataCy("volume-name-input").type("Hello, World"); cy.contains("button", "Save").should( "not.have.attr", "aria-disabled", - "true" + "true", ); // type original name cy.dataCy("volume-name-input").clear(); cy.dataCy("volume-name-input").type( - "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b858" + "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b858", ); cy.contains("button", "Save").should( "have.attr", "aria-disabled", - "true" + "true", ); cy.contains("Never").click(); cy.contains("button", "Save").should( "not.have.attr", "aria-disabled", - "true" + "true", ); }); it("Clicking on save button should close the modal and show a success toast", () => { cy.dataCy( - "edit-btn-e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b858" + "edit-btn-e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b858", ).click(); cy.dataCy("update-volume-modal").should("be.visible"); cy.dataCy("volume-name-input").type("Hello, World"); cy.contains("button", "Save").should( "not.have.attr", "aria-disabled", - "true" + "true", ); cy.contains("button", "Save").click(); cy.validateToast("success", "Successfully updated volume"); @@ -247,18 +247,18 @@ describe("Spawn volume page", () => { cy.dataCy("migrate-btn-vol-0ae8720b445b771b6").should( "have.attr", "aria-disabled", - "true" + "true", ); }); it("clicking cancel during confirmation renders the Migrate modal form", () => { cy.dataCy( - "migrate-btn-e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b858" + "migrate-btn-e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b858", ).click(); cy.dataCy("distro-input").should("be.visible").click(); cy.dataCy("distro-option-ubuntu1804-workstation").click(); cy.dataCy("migrate-modal").contains("Next").click({ force: true }); cy.dataCy("migrate-modal").contains( - "Are you sure you want to migrate this home volume?" + "Are you sure you want to migrate this home volume?", ); cy.dataCy("distro-input").should("not.exist"); cy.dataCy("migrate-modal").contains("Cancel").click({ force: true }); @@ -266,7 +266,7 @@ describe("Spawn volume page", () => { }); it("open the Migrate modal and spawn a host", () => { cy.dataCy( - "migrate-btn-e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b858" + "migrate-btn-e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b858", ).click(); cy.dataCy("distro-input").click(); cy.dataCy("distro-option-ubuntu1804-workstation").click(); @@ -277,7 +277,7 @@ describe("Spawn volume page", () => { .click({ force: true }); cy.validateToast( "success", - "Volume migration has been scheduled. A new host will be spawned and accessible on your Hosts page." + "Volume migration has been scheduled. A new host will be spawned and accessible on your Hosts page.", ); }); }); diff --git a/cypress/integration/subscription_modal.ts b/cypress/integration/subscription_modal.ts index 901a6564a9..c0cba6d2fd 100644 --- a/cypress/integration/subscription_modal.ts +++ b/cypress/integration/subscription_modal.ts @@ -6,7 +6,7 @@ const testSharedSubscriptionModalFunctionality = ( dataCyModal: string, dataCyToggleModalButton: string, description: string, - type: string + type: string, ) => { describe(description, () => { it("Displays success toast after submitting a valid form and request succeeds", () => { @@ -120,7 +120,7 @@ testSharedSubscriptionModalFunctionality( "task-notification-modal", "notify-task", "Task Subscription Modal", - "task" + "task", ); testSharedSubscriptionModalFunctionality( @@ -128,7 +128,7 @@ testSharedSubscriptionModalFunctionality( "patch-notification-modal", "notify-patch", "Version Subscription Modal", - "version" + "version", ); describe("Waterfall subscription modal", () => { @@ -219,6 +219,6 @@ const saveButtonEnabled = (isEnabled: boolean = true) => { cy.contains("button", "Save").should( isEnabled ? "not.have.attr" : "have.attr", "aria-disabled", - "true" + "true", ); }; diff --git a/cypress/integration/task/aborted_task.ts b/cypress/integration/task/aborted_task.ts index 1fa3799b5f..f6ecacb141 100644 --- a/cypress/integration/task/aborted_task.ts +++ b/cypress/integration/task/aborted_task.ts @@ -1,19 +1,19 @@ describe("Task page for an aborted task", () => { it("Should link to failing task in task metadata should exist for aborted tasks", () => { cy.visit( - "task/mongodb_mongo_main_enterprise_rhel_62_64_bit_dbtest_patch_0af9c85d7e2ba60f592f2d7a9a35217e254e59fb_5ee1efb3d1fe073e194e8b5c_20_06_11_08_48_06" + "task/mongodb_mongo_main_enterprise_rhel_62_64_bit_dbtest_patch_0af9c85d7e2ba60f592f2d7a9a35217e254e59fb_5ee1efb3d1fe073e194e8b5c_20_06_11_08_48_06", ); cy.dataCy("abort-message-failing-task") .should("have.attr", "href") .and( "eq", - "/task/mongodb_mongo_main_commit_queue_validate_commit_message_patch_0af9c85d7e2ba60f592f2d7a9a35217e254e59fb_5ee1efb3d1fe073e194e8b5c_20_06_11_08_48_06" + "/task/mongodb_mongo_main_commit_queue_validate_commit_message_patch_0af9c85d7e2ba60f592f2d7a9a35217e254e59fb_5ee1efb3d1fe073e194e8b5c_20_06_11_08_48_06", ); }); it("Should not contain an abort message for non-aborted tasks", () => { cy.visit( - "task/mongodb_mongo_main_commit_queue_validate_commit_message_patch_0af9c85d7e2ba60f592f2d7a9a35217e254e59fb_5ee1efb3d1fe073e194e8b5c_20_06_11_08_48_06" + "task/mongodb_mongo_main_commit_queue_validate_commit_message_patch_0af9c85d7e2ba60f592f2d7a9a35217e254e59fb_5ee1efb3d1fe073e194e8b5c_20_06_11_08_48_06", ); cy.dataCy("abort-message-failing-task").should("not.exist"); }); diff --git a/cypress/integration/task/select_execution.ts b/cypress/integration/task/select_execution.ts index c3f5376812..c14430fe4e 100644 --- a/cypress/integration/task/select_execution.ts +++ b/cypress/integration/task/select_execution.ts @@ -1,7 +1,7 @@ describe("Selecting Task Execution", () => { beforeEach(() => { cy.visit( - "/task/logkeeper_ubuntu_test_edd78c1d581bf757a880777b00685321685a8e67_16_10_20_21_58_58/logs" + "/task/logkeeper_ubuntu_test_edd78c1d581bf757a880777b00685321685a8e67_16_10_20_21_58_58/logs", ); // Wait for page to finish loading. cy.contains("No logs found").should("exist"); diff --git a/cypress/integration/task/task_logs.ts b/cypress/integration/task/task_logs.ts index 69b5ff4517..cbb2ef71f4 100644 --- a/cypress/integration/task/task_logs.ts +++ b/cypress/integration/task/task_logs.ts @@ -41,13 +41,13 @@ describe("task logs", () => { .should("have.attr", "href") .and( "includes", - "task_log_raw/evergreen_ubuntu1604_test_model_patch_5e823e1f28baeaa22ae00823d83e03082cd148ab_5e4ff3abe3c3317e352062e4_20_02_21_15_13_48/0?type=S" + "task_log_raw/evergreen_ubuntu1604_test_model_patch_5e823e1f28baeaa22ae00823d83e03082cd148ab_5e4ff3abe3c3317e352062e4_20_02_21_15_13_48/0?type=S", ); cy.dataCy("raw-log-btn") .should("have.attr", "href") .and( "includes", - "/task_log_raw/evergreen_ubuntu1604_test_model_patch_5e823e1f28baeaa22ae00823d83e03082cd148ab_5e4ff3abe3c3317e352062e4_20_02_21_15_13_48/0?type=S&text=true" + "/task_log_raw/evergreen_ubuntu1604_test_model_patch_5e823e1f28baeaa22ae00823d83e03082cd148ab_5e4ff3abe3c3317e352062e4_20_02_21_15_13_48/0?type=S&text=true", ); }); diff --git a/cypress/integration/task/task_queue_position.ts b/cypress/integration/task/task_queue_position.ts index 36463ae042..d8d08a947e 100644 --- a/cypress/integration/task/task_queue_position.ts +++ b/cypress/integration/task/task_queue_position.ts @@ -10,7 +10,7 @@ describe("Task Queue Position", () => { .should("have.attr", "href") .and( "eq", - "/task-queue/archlinux-test/evergreen_lint_lint_service_patch_5e823e1f28baeaa22ae00823d83e03082cd148ab_5e4ff3abe3c3317e352062e4_20_02_21_15_13_48" + "/task-queue/archlinux-test/evergreen_lint_lint_service_patch_5e823e1f28baeaa22ae00823d83e03082cd148ab_5e4ff3abe3c3317e352062e4_20_02_21_15_13_48", ); }); diff --git a/cypress/integration/task/test_table.ts b/cypress/integration/task/test_table.ts index 743bb6818d..0488dd733a 100644 --- a/cypress/integration/task/test_table.ts +++ b/cypress/integration/task/test_table.ts @@ -132,7 +132,7 @@ describe("Tests Table", () => { clickOnPageBtnAndAssertURLandTableResults( dataCyNextPage, secondPageDisplayNames, - 1 + 1, ); }); @@ -142,7 +142,7 @@ describe("Tests Table", () => { clickOnPageBtnAndAssertURLandTableResults( dataCyNextPage, secondPageDisplayNames, - 1 + 1, ); }); @@ -152,7 +152,7 @@ describe("Tests Table", () => { clickOnPageBtnAndAssertURLandTableResults( dataCyPrevPage, firstPageDisplayNames, - 0 + 0, ); }); @@ -162,7 +162,7 @@ describe("Tests Table", () => { clickOnPageBtnAndAssertURLandTableResults( dataCyPrevPage, firstPageDisplayNames, - 0 + 0, ); }); }); diff --git a/cypress/integration/taskQueue/route.ts b/cypress/integration/taskQueue/route.ts index 43c4cfa412..8ce8cdd562 100644 --- a/cypress/integration/taskQueue/route.ts +++ b/cypress/integration/taskQueue/route.ts @@ -54,7 +54,7 @@ describe("Task Queue", () => { it("Scrolls to current task if taskId param in url", () => { cy.visit( - "/task-queue/osx-108/evergreen_lint_lint_service_patch_5e823e1f28baeaa22ae00823d83e03082cd148ab_5e4ff3abe3c3317e352062e4_20_02_21_15_13_48" + "/task-queue/osx-108/evergreen_lint_lint_service_patch_5e823e1f28baeaa22ae00823d83e03082cd148ab_5e4ff3abe3c3317e352062e4_20_02_21_15_13_48", ); cy.dataCy("task-queue-table").should("exist"); cy.get(".ant-table-row-selected").should("exist"); @@ -66,7 +66,7 @@ describe("Task Queue", () => { it("Task links goes to Spruce for both patches and mainline commits", () => { cy.visit( - "/task-queue/osx-108/evergreen_lint_lint_service_patch_5e823e1f28baeaa22ae00823d83e03082cd148ab_5e4ff3abe3c3317e352062e4_20_02_21_15_13_48" + "/task-queue/osx-108/evergreen_lint_lint_service_patch_5e823e1f28baeaa22ae00823d83e03082cd148ab_5e4ff3abe3c3317e352062e4_20_02_21_15_13_48", ); // patch diff --git a/cypress/integration/version/downstream_projects.ts b/cypress/integration/version/downstream_projects.ts index f61cb2528e..2cadc53ce4 100644 --- a/cypress/integration/version/downstream_projects.ts +++ b/cypress/integration/version/downstream_projects.ts @@ -23,7 +23,7 @@ describe("Downstream Projects Tab", () => { .should("have.attr", "href") .and( "includes", - "/version/logkeeper_3c5a8112efdb98f3710b89d553af602e355aa5c9" + "/version/logkeeper_3c5a8112efdb98f3710b89d553af602e355aa5c9", ); }); diff --git a/cypress/integration/version/name_change_modal.ts b/cypress/integration/version/name_change_modal.ts index 5e4f78866a..ecb6c0b2b4 100644 --- a/cypress/integration/version/name_change_modal.ts +++ b/cypress/integration/version/name_change_modal.ts @@ -30,13 +30,13 @@ describe("Name change modal", () => { cy.contains("button", "Confirm").should( "have.attr", "aria-disabled", - "true" + "true", ); cy.get("textarea").type("lol"); cy.contains("button", "Confirm").should( "have.attr", "aria-disabled", - "false" + "false", ); const over300Chars = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"; @@ -44,7 +44,7 @@ describe("Name change modal", () => { cy.contains("button", "Confirm").should( "have.attr", "aria-disabled", - "true" + "true", ); cy.contains("Value cannot exceed 300 characters"); }); diff --git a/cypress/integration/version/patch_with_aborted_task.ts b/cypress/integration/version/patch_with_aborted_task.ts index c84c1a5709..839e8c6128 100644 --- a/cypress/integration/version/patch_with_aborted_task.ts +++ b/cypress/integration/version/patch_with_aborted_task.ts @@ -6,7 +6,7 @@ describe("Patch with aborted task", () => { cy.get(`[data-row-key=${taskId}] > .cy-task-table-col-STATUS`).within( () => { cy.dataCy("task-status-badge").should("have.text", "Aborted"); - } + }, ); }); }); diff --git a/cypress/integration/version/restart_modal.ts b/cypress/integration/version/restart_modal.ts index 88d164b7b6..1cb5b8067d 100644 --- a/cypress/integration/version/restart_modal.ts +++ b/cypress/integration/version/restart_modal.ts @@ -38,7 +38,7 @@ describe("Restarting a patch", () => { cy.dataCy("version-restart-modal").should( "contain.text", - "Are you sure you want to restart the 1 selected tasks?" + "Are you sure you want to restart the 1 selected tasks?", ); cy.dataCy("task-status-filter").click(); cy.getInputByLabel("All").check({ force: true }); @@ -55,7 +55,7 @@ describe("Restarting a patch", () => { // support cy-data elements currently cy.dataCy("confirmation-message").should( "contain.text", - "Are you sure you want to restart the 1 selected tasks?" + "Are you sure you want to restart the 1 selected tasks?", ); cy.dataCy("base-task-status-filter").click(); @@ -80,7 +80,7 @@ describe("Restarting mainline commits", () => { cy.dataCy("restart-version").should( "not.have.attr", "aria-disabled", - "true" + "true", ); cy.dataCy("restart-version").click(); cy.dataCy("version-restart-modal").should("be.visible"); @@ -91,7 +91,7 @@ describe("Restarting mainline commits", () => { cy.contains("button", "Restart").should( "not.have.attr", "aria-disabled", - "true" + "true", ); cy.contains("button", "Restart").click(); }); diff --git a/cypress/integration/version/routes.ts b/cypress/integration/version/routes.ts index 2bd88b5b1d..2b7aec448d 100644 --- a/cypress/integration/version/routes.ts +++ b/cypress/integration/version/routes.ts @@ -61,7 +61,7 @@ describe("Version route", () => { cy.dataCy("build-variants").within(() => { cy.dataCy("patch-build-variant").within( // @ts-expect-error - ($variants) => Array.from($variants).length > 0 + ($variants) => Array.from($variants).length > 0, ); }); }); @@ -95,7 +95,7 @@ describe("Version route", () => { .and("equal", "true"); cy.location("search").should( "include", - "sorts=STATUS%3AASC%3BBASE_STATUS%3ADESC&statuses=success&variant=%5Eubuntu1604%24" + "sorts=STATUS%3AASC%3BBASE_STATUS%3ADESC&statuses=success&variant=%5Eubuntu1604%24", ); // Check that filter values have updated. @@ -126,7 +126,7 @@ describe("Version route", () => { }); cy.location("search").should( "include", - "sorts=STATUS%3AASC%3BBASE_STATUS%3ADESC&statuses=success&variant=%5Eubuntu1604%24" + "sorts=STATUS%3AASC%3BBASE_STATUS%3ADESC&statuses=success&variant=%5Eubuntu1604%24", ); }); }); @@ -149,7 +149,7 @@ describe("Version route", () => { .and("equal", "true"); cy.location("search").should( "include", - "sorts=STATUS%3AASC%3BBASE_STATUS%3ADESC&variant=%5Eubuntu1604%24" + "sorts=STATUS%3AASC%3BBASE_STATUS%3ADESC&variant=%5Eubuntu1604%24", ); // Check that filter values have updated. @@ -173,7 +173,7 @@ describe("Version route", () => { cy.dataCy("build-variant-display-name").first().click(); cy.location("search").should( "include", - "sorts=STATUS%3AASC%3BBASE_STATUS%3ADESC&variant=%5Eubuntu1604%24" + "sorts=STATUS%3AASC%3BBASE_STATUS%3ADESC&variant=%5Eubuntu1604%24", ); }); }); @@ -189,7 +189,7 @@ describe("Version route", () => { .should( "have.attr", "href", - "https://jira.example.com/browse/EVG-7425" + "https://jira.example.com/browse/EVG-7425", ); }); @@ -199,7 +199,7 @@ describe("Version route", () => { .should( "have.attr", "href", - "https://github.com/evergreen-ci/evergreen/pull/3186" + "https://github.com/evergreen-ci/evergreen/pull/3186", ); }); }); diff --git a/cypress/integration/version/schedule_modal.ts b/cypress/integration/version/schedule_modal.ts index 72c243d93b..431682096c 100644 --- a/cypress/integration/version/schedule_modal.ts +++ b/cypress/integration/version/schedule_modal.ts @@ -5,7 +5,7 @@ describe("Restarting and scheduling mainline commits", () => { cy.dataCy("schedule-patch").should( "not.have.attr", "aria-disabled", - "true" + "true", ); cy.dataCy("schedule-patch").click(); cy.dataCy("schedule-tasks-modal").should("be.visible"); @@ -16,7 +16,7 @@ describe("Restarting and scheduling mainline commits", () => { cy.contains("button", "Schedule").should( "not.have.attr", "aria-disabled", - "true" + "true", ); cy.contains("button", "Schedule").click({ force: true }); }); diff --git a/cypress/integration/version/subscription_modal.ts b/cypress/integration/version/subscription_modal.ts index 5fa15dd13e..e96683b194 100644 --- a/cypress/integration/version/subscription_modal.ts +++ b/cypress/integration/version/subscription_modal.ts @@ -36,7 +36,7 @@ describe("Version Subscription Modal", () => { cy.contains("Build Variant ID").should( "have.css", "cursor", - "not-allowed" + "not-allowed", ); }); }); @@ -48,7 +48,7 @@ describe("Version Subscription Modal", () => { cy.contains("button", "Save").should( "not.have.attr", "aria-disabled", - "true" + "true", ); cy.contains("button", "Save").click(); cy.validateToast("success", "Your subscription has been added"); @@ -96,13 +96,13 @@ describe("Version Subscription Modal", () => { cy.contains("Add Additional Criteria").should( "not.have.attr", "aria-disabled", - "true" + "true", ); cy.contains("Add Additional Criteria").click(); cy.contains("Add Additional Criteria").should( "not.have.attr", "aria-disabled", - "true" + "true", ); cy.contains("Add Additional Criteria").click(); cy.contains("Add Additional Criteria").should("not.exist"); diff --git a/cypress/integration/version/task_duration.ts b/cypress/integration/version/task_duration.ts index 84fe44a5d0..38705bf282 100644 --- a/cypress/integration/version/task_duration.ts +++ b/cypress/integration/version/task_duration.ts @@ -8,12 +8,12 @@ describe("Task Duration Tab", () => { // Apply text filter. cy.dataCy("task-name-filter-popover").click(); cy.dataCy("task-name-filter-popover-input-filter").type( - `${filterText}{enter}` + `${filterText}{enter}`, ); cy.dataCy("leafygreen-table-row").should("have.length", 1); cy.location("search").should( "include", - `duration=DESC&page=0&taskName=${filterText}` + `duration=DESC&page=0&taskName=${filterText}`, ); // Clear text filter. cy.dataCy("task-name-filter-popover").click(); @@ -26,17 +26,17 @@ describe("Task Duration Tab", () => { // Apply status filter. cy.dataCy("status-filter-popover").click(); cy.dataCy("tree-select-options").within(() => - cy.contains("Running").click({ force: true }) + cy.contains("Running").click({ force: true }), ); cy.dataCy("leafygreen-table-row").should("have.length", 3); cy.location("search").should( "include", - "duration=DESC&page=0&statuses=running-umbrella%2Cstarted%2Cdispatched" + "duration=DESC&page=0&statuses=running-umbrella%2Cstarted%2Cdispatched", ); // Clear status filter. cy.dataCy("status-filter-popover").click(); cy.dataCy("tree-select-options").within(() => - cy.contains("Succeeded").click({ force: true }) + cy.contains("Succeeded").click({ force: true }), ); cy.location("search").should("include", `duration=DESC&page=0`); }); @@ -46,12 +46,12 @@ describe("Task Duration Tab", () => { // Apply text filter. cy.dataCy("build-variant-filter-popover").click(); cy.dataCy("build-variant-filter-popover-input-filter").type( - `${filterText}{enter}` + `${filterText}{enter}`, ); cy.dataCy("leafygreen-table-row").should("have.length", 2); cy.location("search").should( "include", - `duration=DESC&page=0&variant=${filterText}` + `duration=DESC&page=0&variant=${filterText}`, ); // Clear text filter. cy.dataCy("build-variant-filter-popover").click(); @@ -91,11 +91,11 @@ describe("Task Duration Tab", () => { cy.dataCy("task-name-filter-popover").click(); cy.dataCy("task-name-filter-popover-input-filter").type( - `${filterText}{enter}` + `${filterText}{enter}`, ); cy.dataCy("task-name-filter-popover-task-duration-table-row").should( "have.length", - 0 + 0, ); cy.contains("No tasks found.").should("exist"); }); diff --git a/cypress/integration/version/task_filters.ts b/cypress/integration/version/task_filters.ts index c61e6e55ce..8920e512cb 100644 --- a/cypress/integration/version/task_filters.ts +++ b/cypress/integration/version/task_filters.ts @@ -137,7 +137,7 @@ describe("Tasks filters", () => { .then((postFilterCount) => { cy.dataCy("filtered-count").should( "not.have.text", - preFilterCount + preFilterCount, ); selectCheckboxOption("Succeeded", true); urlSearchParamsAreUpdated({ @@ -148,7 +148,7 @@ describe("Tasks filters", () => { waitForTaskTable(); cy.dataCy("filtered-count").should( "not.have.text", - postFilterCount + postFilterCount, ); }); }); diff --git a/cypress/integration/version/task_table.ts b/cypress/integration/version/task_table.ts index 76c8fa8f48..c119afc102 100644 --- a/cypress/integration/version/task_table.ts +++ b/cypress/integration/version/task_table.ts @@ -23,43 +23,43 @@ describe("Task table", () => { cy.wait(200); cy.location("search").should( "contain", - "sorts=STATUS%3AASC%3BBASE_STATUS%3ADESC" + "sorts=STATUS%3AASC%3BBASE_STATUS%3ADESC", ); cy.get("th.cy-task-table-col-NAME").click({ force: true }); cy.location("search").should( "contain", - "sorts=STATUS%3AASC%3BBASE_STATUS%3ADESC%3BNAME%3AASC" + "sorts=STATUS%3AASC%3BBASE_STATUS%3ADESC%3BNAME%3AASC", ); cy.get("th.cy-task-table-col-NAME").click({ force: true }); cy.location("search").should( "contain", - "sorts=STATUS%3AASC%3BBASE_STATUS%3ADESC%3BNAME%3ADESC" + "sorts=STATUS%3AASC%3BBASE_STATUS%3ADESC%3BNAME%3ADESC", ); cy.get("th.cy-task-table-col-NAME").click({ force: true }); cy.location("search").should( "contain", - "sorts=STATUS%3AASC%3BBASE_STATUS%3ADESC" + "sorts=STATUS%3AASC%3BBASE_STATUS%3ADESC", ); cy.get("th.cy-task-table-col-VARIANT").click({ force: true }); cy.location("search").should( "contain", - "sorts=STATUS%3AASC%3BBASE_STATUS%3ADESC%3BVARIANT%3AASC" + "sorts=STATUS%3AASC%3BBASE_STATUS%3ADESC%3BVARIANT%3AASC", ); cy.get("th.cy-task-table-col-VARIANT").click({ force: true }); cy.location("search").should( "contain", - "sorts=STATUS%3AASC%3BBASE_STATUS%3ADESC%3BVARIANT%3ADESC" + "sorts=STATUS%3AASC%3BBASE_STATUS%3ADESC%3BVARIANT%3ADESC", ); cy.get("th.cy-task-table-col-VARIANT").click({ force: true }); cy.location("search").should( "contain", - "sorts=STATUS%3AASC%3BBASE_STATUS%3ADESC" + "sorts=STATUS%3AASC%3BBASE_STATUS%3ADESC", ); }); @@ -80,7 +80,7 @@ describe("Task table", () => { cy.contains(TABLE_SORT_SELECTOR, "Name").click(); cy.once("fail", (err) => { expect(err.message).to.include( - "'pointer-events: none' prevents user mouse interaction." + "'pointer-events: none' prevents user mouse interaction.", ); }); }); @@ -140,7 +140,7 @@ describe("Task table", () => { cy.get(dataCyTableRows).should("be.visible"); clickOnPageSizeBtnAndAssertURLandTableSize( pageSize, - dataCyTableDataRows + dataCyTableDataRows, ); }); }); diff --git a/cypress/integration/version/unscheduled_patch/configure_patch.ts b/cypress/integration/version/unscheduled_patch/configure_patch.ts index 7bb4097458..efbe14b7c5 100644 --- a/cypress/integration/version/unscheduled_patch/configure_patch.ts +++ b/cypress/integration/version/unscheduled_patch/configure_patch.ts @@ -10,8 +10,8 @@ describe("Configure Patch Page", () => { cy.visit(`/version/${unactivatedPatchId}`); cy.location().should((loc) => expect(loc.pathname).to.eq( - `/patch/${unactivatedPatchId}/configure/tasks` - ) + `/patch/${unactivatedPatchId}/configure/tasks`, + ), ); }); it("Patch name input field value is patch description", () => { @@ -30,7 +30,7 @@ describe("Configure Patch Page", () => { cy.dataCy("cancel-button").should("exist"); cy.dataCy("cancel-button").click(); cy.location().should((loc) => - expect(loc.pathname).to.eq(`/version/5ecedafb562343215a7ff297/tasks`) + expect(loc.pathname).to.eq(`/version/5ecedafb562343215a7ff297/tasks`), ); }); it("should not allow canceling an unconfigured patch", () => { @@ -44,7 +44,7 @@ describe("Configure Patch Page", () => { cy.get('button[data-cy="tasks-tab"]').should( "have.attr", "aria-selected", - "true" + "true", ); cy.dataCy("tasks-tab").should("be.visible"); }); @@ -72,17 +72,17 @@ describe("Configure Patch Page", () => { cy.get('button[data-cy="changes-tab"]').click(); cy.location("pathname").should( "eq", - `/patch/${unactivatedPatchId}/configure/changes` + `/patch/${unactivatedPatchId}/configure/changes`, ); cy.get('button[data-cy="parameters-tab"]').click(); cy.location("pathname").should( "eq", - `/patch/${unactivatedPatchId}/configure/parameters` + `/patch/${unactivatedPatchId}/configure/parameters`, ); cy.get('button[data-cy="tasks-tab"]').click(); cy.location("pathname").should( "eq", - `/patch/${unactivatedPatchId}/configure/tasks` + `/patch/${unactivatedPatchId}/configure/tasks`, ); }); it("Navigating away from the configure tab should disable the build variant selector", () => { @@ -91,7 +91,7 @@ describe("Configure Patch Page", () => { cy.dataCy("build-variant-select-wrapper").should( "have.css", "pointer-events", - "none" + "none", ); }); }); @@ -146,7 +146,7 @@ describe("Configure Patch Page", () => { .should("not.exist"); let count = 0; cy.dataCy("selected-task-disclaimer").contains( - `${count} tasks across 0 build variants` + `${count} tasks across 0 build variants`, ); cy.dataCy("task-checkbox").each(($el) => { cy.wrap($el).should("not.be.checked"); @@ -174,7 +174,7 @@ describe("Configure Patch Page", () => { .find('[data-cy="task-count-badge"]') .should("contain.text", "1"); cy.dataCy("selected-task-disclaimer").contains( - "1 task across 1 build variant" + "1 task across 1 build variant", ); cy.dataCy("task-checkbox").uncheck({ force: true }); @@ -183,7 +183,7 @@ describe("Configure Patch Page", () => { .find('[data-cy="task-count-badge"]') .should("not.exist"); cy.dataCy("selected-task-disclaimer").contains( - "0 tasks across 0 build variants" + "0 tasks across 0 build variants", ); }); @@ -193,13 +193,13 @@ describe("Configure Patch Page", () => { cy.contains("Ubuntu 16.04").click(); cy.dataCy("task-checkbox").should("have.length", 45); cy.dataCy("selected-task-disclaimer").contains( - `0 tasks across 0 build variants` + `0 tasks across 0 build variants`, ); cy.dataCy("task-filter-input").type("dist"); cy.dataCy("task-checkbox").should("have.length", 2); cy.contains("Select all tasks in view").click(); cy.dataCy("selected-task-disclaimer").contains( - "2 tasks across 1 build variant" + "2 tasks across 1 build variant", ); }); it("The task filter input works across multiple build variants", () => { @@ -216,13 +216,13 @@ describe("Configure Patch Page", () => { }); cy.dataCy("task-checkbox").should("have.length", 46); cy.dataCy("selected-task-disclaimer").contains( - `0 tasks across 0 build variants` + `0 tasks across 0 build variants`, ); cy.dataCy("task-filter-input").type("dist"); cy.dataCy("task-checkbox").should("have.length", 2); cy.contains("Select all tasks in view").click(); cy.dataCy("selected-task-disclaimer").contains( - "4 tasks across 2 build variants" + "4 tasks across 2 build variants", ); cy.dataCy("task-filter-input").clear(); }); @@ -270,7 +270,7 @@ describe("Configure Patch Page", () => { cy.dataCy("select-all-checkbox").should( "have.attr", "aria-checked", - "mixed" + "mixed", ); }); it("Selecting all tasks on an an indeterminate state should check all the checkboxes", () => { @@ -298,14 +298,14 @@ describe("Configure Patch Page", () => { cy.dataCy("task-count-badge").contains("1"); cy.dataCy("selected-task-disclaimer").contains( - "1 task across 1 build variant" + "1 task across 1 build variant", ); cy.getInputByLabel("test-agent").uncheck({ force: true, }); cy.dataCy("task-count-badge").should("not.exist"); cy.dataCy("selected-task-disclaimer").contains( - "0 tasks across 0 build variants" + "0 tasks across 0 build variants", ); }); it("Selecting multiple build variants should display deduplicated task checkboxes", () => { @@ -425,7 +425,7 @@ describe("Configure Patch Page", () => { cy.dataCy("selected-task-disclaimer").contains( `${ variant1TaskCount + variant2TaskCount - } tasks across 2 build variants` + } tasks across 2 build variants`, ); }); }); @@ -469,7 +469,7 @@ describe("Configure Patch Page", () => { }); cy.dataCy("selected-task-disclaimer").contains( - `0 tasks across 0 build variants` + `0 tasks across 0 build variants`, ); }); }); @@ -517,11 +517,11 @@ describe("Configure Patch Page", () => { }); cy.dataCy("selected-task-disclaimer").contains( - `0 tasks across 0 build variants, 1 trigger alias` + `0 tasks across 0 build variants, 1 trigger alias`, ); cy.dataCy("trigger-alias-list-item").find( - '[data-cy="task-count-badge"]' + '[data-cy="task-count-badge"]', ); cy.dataCy("trigger-alias-list-item") .find('[data-cy="task-count-badge"]') @@ -583,7 +583,7 @@ describe("Configure Patch Page", () => { cy.dataCy("schedule-patch").click(); cy.location("pathname").should( "eq", - `/version/${activatedPatchId}/tasks` + `/version/${activatedPatchId}/tasks`, ); }); }); diff --git a/cypress/support/commands.ts b/cypress/support/commands.ts index 9a5e94e758..7fc0e052f3 100644 --- a/cypress/support/commands.ts +++ b/cypress/support/commands.ts @@ -23,7 +23,7 @@ Cypress.Commands.add( "dataRowKey", (value: string, options: cyGetOptions = {}) => { cy.get(`[data-row-key=${value}]`, options); - } + }, ); /* dataTestId */ @@ -31,7 +31,7 @@ Cypress.Commands.add( "dataTestId", (value: string, options: cyGetOptions = {}) => { cy.get(`[data-test-id=${value}]`, options); - } + }, ); /** @@ -78,7 +78,7 @@ Cypress.Commands.add("toggleTableFilter", (colNum: number) => { cy.get(selector).should("be.visible"); cy.get(selector).find("[role=button]").first().click(); cy.get(":not(.ant-dropdown-hidden) > .ant-table-filter-dropdown").should( - "be.visible" + "be.visible", ); }); @@ -97,7 +97,7 @@ Cypress.Commands.add( default: cy.get("svg[aria-label='Unsorted Icon']").should("be.visible"); } - } + }, ); /* validateToast */ @@ -115,7 +115,7 @@ Cypress.Commands.add( }); cy.dataCy("toast").should("not.exist"); } - } + }, ); /* selectLGOption */ @@ -128,7 +128,7 @@ Cypress.Commands.add( cy.get('[role="listbox"]').within(() => { cy.contains(option).click(); }); - } + }, ); Cypress.Commands.add("overwriteGQL", (operationName: string, body: any) => { diff --git a/cypress/support/e2e.ts b/cypress/support/e2e.ts index ea5d8adeba..27b2d69c15 100644 --- a/cypress/support/e2e.ts +++ b/cypress/support/e2e.ts @@ -49,7 +49,7 @@ declare global { */ dataCy( value: string, - options?: Parameters[1] + options?: Parameters[1], ): Chainable; /** * Custom command to select DOM element by data-row-key attribute. @@ -57,7 +57,7 @@ declare global { */ dataRowKey( value: string, - options?: Parameters[1] + options?: Parameters[1], ): Chainable; /** * Custom command to select DOM element by data-test-id attribute. @@ -65,7 +65,7 @@ declare global { */ dataTestId( value: string, - options?: Parameters[1] + options?: Parameters[1], ): Chainable; /** * Custom command to enter credentials in username and password input @@ -113,7 +113,7 @@ declare global { validateToast( type: "success" | "warning" | "error" | "info", message?: string, - shouldClose?: boolean + shouldClose?: boolean, ): void; /** * Custom command to overwrite a GQL response diff --git a/cypress/utils/graphql-test-utils.ts b/cypress/utils/graphql-test-utils.ts index 572953dbf9..b7fe5ab0d5 100644 --- a/cypress/utils/graphql-test-utils.ts +++ b/cypress/utils/graphql-test-utils.ts @@ -3,7 +3,7 @@ import { CyHttpMessages } from "cypress/types/net-stubbing"; // Utility to match GraphQL based on the operation name export const hasOperationName = ( req: CyHttpMessages.IncomingHttpRequest, - operationName: string + operationName: string, ): boolean => { const { body } = req; return ( diff --git a/cypress/utils/index.ts b/cypress/utils/index.ts index f2b7048e2d..9482ad0497 100644 --- a/cypress/utils/index.ts +++ b/cypress/utils/index.ts @@ -38,7 +38,7 @@ export const urlSearchParamsAreUpdated = ({ paramName, pathname, search }) => { export const clickOnPageBtnAndAssertURLandTableResults = ( dataCyPageBtn: string, tableDisplayNames: string[], - pageQueryParamValue: number + pageQueryParamValue: number, ) => { cy.dataCy(dataCyPageBtn).first().should("be.visible"); cy.dataCy(dataCyPageBtn).first().should("not.be.disabled"); @@ -56,7 +56,7 @@ export const clickOnPageBtnAndAssertURLandTableResults = ( */ export const clickOnPageSizeBtnAndAssertURLandTableSize = ( pageSize: number, - dataCyTableRows: string + dataCyTableRows: string, ) => { cy.get("button[aria-labelledby='page-size-select']").click(); cy.contains(`${pageSize} / page`).click(); diff --git a/cypress/utils/subscriptionModal.ts b/cypress/utils/subscriptionModal.ts index f26058672f..3c5ea27bc5 100644 --- a/cypress/utils/subscriptionModal.ts +++ b/cypress/utils/subscriptionModal.ts @@ -1,6 +1,6 @@ export const openSubscriptionModal = ( route: string, - dataCyToggleModalButton: string + dataCyToggleModalButton: string, ) => { cy.visit(route); cy.dataCy(dataCyToggleModalButton).click(); diff --git a/package.json b/package.json index a9e3f7722e..cbc06af97e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "spruce", - "version": "3.0.188", + "version": "3.0.191", "private": true, "scripts": { "bootstrap-logkeeper": "./scripts/bootstrap-logkeeper.sh", @@ -173,14 +173,14 @@ "cypress": "12.17.1", "eslint": "8.19.0", "eslint-config-airbnb": "19.0.4", - "eslint-config-prettier": "9.0.0", + "eslint-config-prettier": "9.1.0", "eslint-plugin-check-file": "2.6.2", "eslint-plugin-cypress": "^2.12.1", "eslint-plugin-import": "2.26.0", "eslint-plugin-jest": "27.2.1", "eslint-plugin-jsdoc": "48.0.2", "eslint-plugin-jsx-a11y": "6.7.1", - "eslint-plugin-prettier": "4.2.1", + "eslint-plugin-prettier": "5.1.3", "eslint-plugin-react": "7.30.1", "eslint-plugin-react-hooks": "4.6.0", "eslint-plugin-sort-destructure-keys": "^1.5.0", @@ -200,7 +200,7 @@ "lint-staged": "13.0.3", "mutation-observer": "1.0.3", "path": "0.12.7", - "prettier": "2.8.8", + "prettier": "3.2.2", "prompts": "^2.4.2", "react-app-polyfill": "^2.0.0", "react-inspector": "^6.0.2", diff --git a/src/App.tsx b/src/App.tsx index bdeeed3af7..e5595dd3d0 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -18,8 +18,8 @@ const browserRouter = createBrowserRouter( <> } /> } /> - - ) + , + ), ); const App: React.FC = () => ( diff --git a/src/analytics/addPageAction.ts b/src/analytics/addPageAction.ts index b3e1c58fff..4f3d4949f3 100644 --- a/src/analytics/addPageAction.ts +++ b/src/analytics/addPageAction.ts @@ -44,7 +44,7 @@ export interface Properties { export const addPageAction = ( { name, ...actionProps }: A, - properties: P & RequiredProperties + properties: P & RequiredProperties, ) => { const { newrelic } = window; const { search } = window.location; diff --git a/src/analytics/task/useAnnotationAnalytics.ts b/src/analytics/task/useAnnotationAnalytics.ts index 589d4c22f4..c6684e0260 100644 --- a/src/analytics/task/useAnnotationAnalytics.ts +++ b/src/analytics/task/useAnnotationAnalytics.ts @@ -42,7 +42,7 @@ export const useAnnotationAnalytics = () => { { variables: { taskId: id, execution }, fetchPolicy: "cache-first", - } + }, ); const { annotation } = eventData?.task || {}; diff --git a/src/analytics/useAnalyticsRoot.ts b/src/analytics/useAnalyticsRoot.ts index 9105e0c14b..3d2a8efcb0 100644 --- a/src/analytics/useAnalyticsRoot.ts +++ b/src/analytics/useAnalyticsRoot.ts @@ -11,7 +11,7 @@ interface P extends Properties {} export const useAnalyticsRoot = ( object: AnalyticsObject, - attributes: { [key: string]: any } = {} + attributes: { [key: string]: any } = {}, ): Analytics => { const sendEvent: Analytics["sendEvent"] = useCallback( (action) => { @@ -22,7 +22,7 @@ export const useAnalyticsRoot = ( ...attributes, }); }, - [object, attributes] + [object, attributes], ); return useMemo(() => ({ sendEvent }), [sendEvent]); diff --git a/src/analytics/version/useVersionAnalytics.ts b/src/analytics/version/useVersionAnalytics.ts index e812de8d18..fd14ff691a 100644 --- a/src/analytics/version/useVersionAnalytics.ts +++ b/src/analytics/version/useVersionAnalytics.ts @@ -56,7 +56,7 @@ export const useVersionAnalytics = (id: string) => { { variables: { id }, fetchPolicy: "cache-first", - } + }, ); const { status } = eventData?.version || {}; diff --git a/src/components/Banners/AdminBanner.test.tsx b/src/components/Banners/AdminBanner.test.tsx index 42d0182ac1..d1563d9346 100644 --- a/src/components/Banners/AdminBanner.test.tsx +++ b/src/components/Banners/AdminBanner.test.tsx @@ -15,7 +15,7 @@ describe("site banner", () => { render( - + , ); await waitFor(() => { expect(screen.queryByDataCy("sitewide-banner-warning")).toBeVisible(); @@ -28,7 +28,7 @@ describe("site banner", () => { render( - + , ); await waitFor(() => { expect(screen.queryByDataCy("sitewide-banner-success")).toBeVisible(); @@ -41,7 +41,7 @@ describe("site banner", () => { render( - + , ); await waitFor(() => { expect(screen.queryByDataCy("sitewide-banner-danger")).toBeVisible(); @@ -54,7 +54,7 @@ describe("site banner", () => { render( - + , ); await waitFor(() => { expect(screen.queryByDataCy("sitewide-banner-info")).toBeVisible(); @@ -67,7 +67,7 @@ describe("site banner", () => { render( - + , ); await waitFor(() => { expect(screen.queryByDataCy("sitewide-banner-info")).toBeVisible(); @@ -80,7 +80,7 @@ describe("site banner", () => { render( - + , ); await waitFor(() => { expect(screen.queryByDataCy("sitewide-banner-info")).toBeVisible(); diff --git a/src/components/Banners/GithubUsernameBanner.tsx b/src/components/Banners/GithubUsernameBanner.tsx index 5fe6d1e2ee..0cde046ab6 100644 --- a/src/components/Banners/GithubUsernameBanner.tsx +++ b/src/components/Banners/GithubUsernameBanner.tsx @@ -18,7 +18,7 @@ export const GithubUsernameBanner = () => { // USER SETTINGS QUERY const { data: userSettingsData } = useQuery( USER_SETTINGS, - { skip: !isPatchesPage } + { skip: !isPatchesPage }, ); const { userSettings } = userSettingsData || {}; const { githubUser } = userSettings || {}; diff --git a/src/components/Banners/RepotrackerBanner.test.tsx b/src/components/Banners/RepotrackerBanner.test.tsx index b4e0987a67..177525e3c8 100644 --- a/src/components/Banners/RepotrackerBanner.test.tsx +++ b/src/components/Banners/RepotrackerBanner.test.tsx @@ -36,7 +36,7 @@ describe("repotracker banner", () => { const { Component } = RenderFakeToastContext( - + , ); render(); await waitFor(() => { @@ -50,7 +50,7 @@ describe("repotracker banner", () => { const { Component } = RenderFakeToastContext( - + , ); render(); await waitFor(() => { @@ -62,7 +62,7 @@ describe("repotracker banner", () => { const { Component } = RenderFakeToastContext( - + , ); render(); await waitFor(() => { @@ -75,7 +75,7 @@ describe("repotracker banner", () => { const { Component } = RenderFakeToastContext( - + , ); render(); await waitFor(() => { @@ -91,7 +91,7 @@ describe("repotracker banner", () => { mocks={[projectWithError, adminUser, setLastRevision, projectNoError]} > - + , ); render(); await waitFor(() => { diff --git a/src/components/Banners/RepotrackerBanner.tsx b/src/components/Banners/RepotrackerBanner.tsx index 00048a3ab0..3a49260d26 100644 --- a/src/components/Banners/RepotrackerBanner.tsx +++ b/src/components/Banners/RepotrackerBanner.tsx @@ -58,12 +58,12 @@ export const RepotrackerBanner: React.FC = ({ >(SET_LAST_REVISION, { onCompleted: () => { dispatchToast.success( - "Successfully updated merge base revision. The repotracker job has been scheduled to run." + "Successfully updated merge base revision. The repotracker job has been scheduled to run.", ); }, onError: (err) => { dispatchToast.error( - `Error when attempting to update merge base revision: ${err.message}` + `Error when attempting to update merge base revision: ${err.message}`, ); }, }); diff --git a/src/components/Banners/SiteBanner.tsx b/src/components/Banners/SiteBanner.tsx index 1bc64cb1f5..cba9adc27a 100644 --- a/src/components/Banners/SiteBanner.tsx +++ b/src/components/Banners/SiteBanner.tsx @@ -12,7 +12,7 @@ export const SiteBanner: React.FC = ({ text, theme }) => { const spruceConfig = useSpruceConfig(); const jiraHost = spruceConfig?.jira?.host; const [showBanner, setShowBanner] = useState( - text && Cookies.get(text) === undefined + text && Cookies.get(text) === undefined, ); const hideBanner = () => { diff --git a/src/components/Banners/SlackNotificationBanner.tsx b/src/components/Banners/SlackNotificationBanner.tsx index 9d841bcbf8..dfa2ef0038 100644 --- a/src/components/Banners/SlackNotificationBanner.tsx +++ b/src/components/Banners/SlackNotificationBanner.tsx @@ -31,7 +31,7 @@ export const SlackNotificationBanner = () => { onCompleted: () => { hideBanner(); dispatchToast.success( - "You will now receive Slack notifications when your patches fail or succeed" + "You will now receive Slack notifications when your patches fail or succeed", ); }, onError: (err) => { @@ -48,7 +48,7 @@ export const SlackNotificationBanner = () => { const { patchFinish, patchFirstFailure } = notifications || {}; const [slackUsername, setSlackUsername] = useState( - () => defaultSlackUsername + () => defaultSlackUsername, ); const hasClosedSlackBanner = () => diff --git a/src/components/Breadcrumbs/Breadcrumbs.test.tsx b/src/components/Breadcrumbs/Breadcrumbs.test.tsx index 51ed1f2112..41d1d51449 100644 --- a/src/components/Breadcrumbs/Breadcrumbs.test.tsx +++ b/src/components/Breadcrumbs/Breadcrumbs.test.tsx @@ -28,7 +28,7 @@ describe("breadcrumbs", () => { expect(screen.queryByText(longMessage)).not.toBeInTheDocument(); expect( - screen.getByText(trimStringFromMiddle(longMessage, 30)) + screen.getByText(trimStringFromMiddle(longMessage, 30)), ).toBeInTheDocument(); await user.hover(screen.getByText(trimStringFromMiddle(longMessage, 30))); await waitFor(() => { diff --git a/src/components/CodeChanges/index.tsx b/src/components/CodeChanges/index.tsx index a826febd32..cf1811a164 100644 --- a/src/components/CodeChanges/index.tsx +++ b/src/components/CodeChanges/index.tsx @@ -51,11 +51,11 @@ export const CodeChanges: React.FC = ({ patchId }) => { const additions = fileDiffs.reduce( (total, diff) => total + diff.additions, - 0 + 0, ); const deletions = fileDiffs.reduce( (total, diff) => total + diff.deletions, - 0 + 0, ); let codeChanges; diff --git a/src/components/CodeChangesTable/index.tsx b/src/components/CodeChangesTable/index.tsx index 9dcf72fc25..97cc229cff 100644 --- a/src/components/CodeChangesTable/index.tsx +++ b/src/components/CodeChangesTable/index.tsx @@ -26,7 +26,7 @@ const rowKey = (record: FileDiffsFragment): string => `${record.diffLink}_code_table`; const columns: ( - showHeader: boolean + showHeader: boolean, ) => Array> = (showHeader: boolean) => [ { title: File, diff --git a/src/components/CommitChartLabel/CommitChartLabel.test.tsx b/src/components/CommitChartLabel/CommitChartLabel.test.tsx index b5db97b803..8fa5581e5e 100644 --- a/src/components/CommitChartLabel/CommitChartLabel.test.tsx +++ b/src/components/CommitChartLabel/CommitChartLabel.test.tsx @@ -25,7 +25,7 @@ describe("commitChartLabel", () => { renderWithRouterMatch(); expect(screen.queryByDataCy("commit-label")).toHaveTextContent( "4137c33 Jun 16, 2021, 11:38 PM Mohamed Khelif -SERVER-57332 Create skeleton Internal" + - "Git Tags: v1.2.3, v1.2.3-rc0" + "Git Tags: v1.2.3, v1.2.3-rc0", ); }); @@ -33,7 +33,7 @@ describe("commitChartLabel", () => { renderWithRouterMatch(); expect(screen.queryByDataCy("githash-link")).toHaveAttribute( "href", - "/version/123/tasks" + "/version/123/tasks", ); }); @@ -42,7 +42,7 @@ describe("commitChartLabel", () => { await waitFor(() => { expect(screen.queryByDataCy("jira-link")).toHaveAttribute( "href", - "https://jira.mongodb.org/browse/SERVER-57332" + "https://jira.mongodb.org/browse/SERVER-57332", ); }); }); @@ -52,14 +52,14 @@ describe("commitChartLabel", () => { expect(screen.getByText("more")).toBeInTheDocument(); expect(screen.queryByDataCy("commit-label")).toHaveTextContent( "4137c33 Jun 16, 2021, 11:38 PM Mohamed Khelif -SERVER-57332 Create skeleton Internal...more" + - "Git Tags: v1.2.3, v1.2.3-rc0" + "Git Tags: v1.2.3, v1.2.3-rc0", ); }); it("displays entire commit message if it does not break length limit", () => { renderWithRouterMatch(); expect(screen.queryByDataCy("commit-label")).toHaveTextContent( - "SERVER-57332 Create skeleton Internal" + "SERVER-57332 Create skeleton Internal", ); }); @@ -71,13 +71,13 @@ describe("commitChartLabel", () => { await user.click(screen.queryByText("more")); await waitFor(() => { expect( - screen.getByDataCy("long-commit-message-tooltip") + screen.getByDataCy("long-commit-message-tooltip"), ).toBeInTheDocument(); }); expect( - screen.queryByDataCy("long-commit-message-tooltip") + screen.queryByDataCy("long-commit-message-tooltip"), ).toHaveTextContent( - "SERVER-57332 Create skeleton InternalDocumentSourceDensify" + "SERVER-57332 Create skeleton InternalDocumentSourceDensify", ); }); diff --git a/src/components/CommitChartLabel/index.tsx b/src/components/CommitChartLabel/index.tsx index b25ac49fc9..5c9884bcaa 100644 --- a/src/components/CommitChartLabel/index.tsx +++ b/src/components/CommitChartLabel/index.tsx @@ -92,7 +92,7 @@ const CommitChartLabel: React.FC = ({ {jiraLinkify( shortenMessage ? shortenedMessage : message, jiraHost, - onClickJiraTicket + onClickJiraTicket, )} {shortenMessage && ( diff --git a/src/components/ConditionalWrapper/ConditionalWrapper.test.tsx b/src/components/ConditionalWrapper/ConditionalWrapper.test.tsx index b713459084..2d4948b4e2 100644 --- a/src/components/ConditionalWrapper/ConditionalWrapper.test.tsx +++ b/src/components/ConditionalWrapper/ConditionalWrapper.test.tsx @@ -12,7 +12,7 @@ describe("conditionalWrapper", () => { wrapper={(children) => {children}} > Some Element - + , ); expect(screen.queryByDataCy("wrapper-1")).toBeVisible(); expect(screen.queryByDataCy("wrapper-1")).toHaveTextContent("Some Element"); @@ -25,7 +25,7 @@ describe("conditionalWrapper", () => { wrapper={(children) => {children}} > Some Element - + , ); expect(screen.queryByDataCy("wrapper-1")).toBeNull(); expect(screen.queryByText("Some Element")).toBeVisible(); @@ -39,7 +39,7 @@ describe("conditionalWrapper", () => { altWrapper={(children) => {children}} > Some Element - + , ); expect(screen.queryByDataCy("wrapper-1")).toBeNull(); expect(screen.queryByDataCy("wrapper-2")).toBeVisible(); diff --git a/src/components/Dropdown/Dropdown.test.tsx b/src/components/Dropdown/Dropdown.test.tsx index 641451d315..8918efd07f 100644 --- a/src/components/Dropdown/Dropdown.test.tsx +++ b/src/components/Dropdown/Dropdown.test.tsx @@ -50,7 +50,7 @@ describe("dropdown", () => { render( {children()} - + , ); expect(screen.queryByText("Some Button")).not.toBeInTheDocument(); expect(screen.getByText("Custom Button")).toBeInTheDocument(); diff --git a/src/components/EditableTagField/EditableTagField.test.tsx b/src/components/EditableTagField/EditableTagField.test.tsx index 4f1090ed77..fb4d04c190 100644 --- a/src/components/EditableTagField/EditableTagField.test.tsx +++ b/src/components/EditableTagField/EditableTagField.test.tsx @@ -28,7 +28,7 @@ describe("editableTagField", () => { inputTags={editableTags} onChange={updateData} buttonText="Add Tag" - /> + />, ); expect(screen.queryAllByDataCy("user-tag-row")).toHaveLength(3); @@ -48,7 +48,7 @@ describe("editableTagField", () => { inputTags={editableTags} onChange={updateData} buttonText="Add Tag" - /> + />, ); expect(data).toStrictEqual(defaultData); @@ -57,7 +57,7 @@ describe("editableTagField", () => { await user.clear(screen.queryAllByDataCy("user-tag-value-field")[0]); await user.type( screen.queryAllByDataCy("user-tag-value-field")[0], - "new value" + "new value", ); expect(screen.queryAllByDataCy("user-tag-edit-icon")[0]).toBeVisible(); @@ -85,7 +85,7 @@ describe("editableTagField", () => { inputTags={editableTags} onChange={updateData} buttonText="Add Tag" - /> + />, ); expect(data).toStrictEqual(defaultData); @@ -110,7 +110,7 @@ describe("editableTagField", () => { inputTags={editableTags} onChange={updateData} buttonText="Add Tag" - /> + />, ); expect(data).toStrictEqual(defaultData); @@ -119,7 +119,7 @@ describe("editableTagField", () => { await user.clear(screen.queryAllByDataCy("user-tag-key-field")[0]); await user.type( screen.queryAllByDataCy("user-tag-key-field")[0], - "new key" + "new key", ); expect(screen.queryAllByDataCy("user-tag-edit-icon")[0]).toBeVisible(); @@ -147,7 +147,7 @@ describe("editableTagField", () => { inputTags={editableTags} onChange={updateData} buttonText="Add Tag" - /> + />, ); expect(data).toStrictEqual(defaultData); @@ -163,13 +163,13 @@ describe("editableTagField", () => { await user.clear(screen.queryAllByDataCy("user-tag-key-field")[3]); await user.type( screen.queryAllByDataCy("user-tag-key-field")[3], - "new key" + "new key", ); await user.clear(screen.queryAllByDataCy("user-tag-value-field")[3]); await user.type( screen.queryAllByDataCy("user-tag-value-field")[3], - "new value" + "new value", ); expect(screen.queryAllByDataCy("user-tag-edit-icon")).toHaveLength(1); diff --git a/src/components/EditableTagField/TagRow.tsx b/src/components/EditableTagField/TagRow.tsx index 897eacd2ba..64e265e072 100644 --- a/src/components/EditableTagField/TagRow.tsx +++ b/src/components/EditableTagField/TagRow.tsx @@ -81,7 +81,7 @@ export const TagRow: React.FC = ({ }); onUpdateTag( { key, value }, - !isNewTag && key !== tag.key ? tag.key : undefined + !isNewTag && key !== tag.key ? tag.key : undefined, ); }} /> diff --git a/src/components/ErrorHandling/Sentry.tsx b/src/components/ErrorHandling/Sentry.tsx index 685da5f5b9..09defe0d5a 100644 --- a/src/components/ErrorHandling/Sentry.tsx +++ b/src/components/ErrorHandling/Sentry.tsx @@ -41,7 +41,7 @@ const isInitialized = () => !!getCurrentHub().getClient(); const sendError = ( err: Error, severity: SeverityLevel, - metadata?: { [key: string]: any } + metadata?: { [key: string]: any }, ) => { withScope((scope) => { setScope(scope, { level: severity, context: metadata }); diff --git a/src/components/ErrorHandling/initialize.test.ts b/src/components/ErrorHandling/initialize.test.ts index 43e2862b54..432b385df0 100644 --- a/src/components/ErrorHandling/initialize.test.ts +++ b/src/components/ErrorHandling/initialize.test.ts @@ -9,7 +9,7 @@ describe("should initialize error handlers according to release stage", () => { jest.spyOn(Sentry, "init").mockImplementation(jest.fn()); jest .spyOn(Sentry, "Replay") - .mockImplementation(() => ({} as Sentry.Replay)); + .mockImplementation(() => ({}) as Sentry.Replay); }); afterEach(() => { diff --git a/src/components/FilterBadges/FilterBadge.tsx b/src/components/FilterBadges/FilterBadge.tsx index 0922d634af..d540e7e173 100644 --- a/src/components/FilterBadges/FilterBadge.tsx +++ b/src/components/FilterBadges/FilterBadge.tsx @@ -26,7 +26,7 @@ const FilterBadge: React.FC = ({ badge, onClose }) => { // the trimmed name needs to account for the label const trimmedBadgeName = trimStringFromMiddle( badge.value, - maxBadgeLength - badge.key.length + maxBadgeLength - badge.key.length, ); return ( diff --git a/src/components/FilterBadges/FilterBadges.stories.tsx b/src/components/FilterBadges/FilterBadges.stories.tsx index 4718ae47fa..63937922e9 100644 --- a/src/components/FilterBadges/FilterBadges.stories.tsx +++ b/src/components/FilterBadges/FilterBadges.stories.tsx @@ -27,8 +27,8 @@ const BadgeContainer = () => { const removeBadge = (badge: FilterBadgeType) => { setBadges( badges.filter( - (b) => (b.key !== badge.key && b.value !== badge.value) || false - ) + (b) => (b.key !== badge.key && b.value !== badge.value) || false, + ), ); }; const onClearAll = () => { diff --git a/src/components/FilterBadges/FilterBadges.test.tsx b/src/components/FilterBadges/FilterBadges.test.tsx index e6215326b4..ec3ac988d7 100644 --- a/src/components/FilterBadges/FilterBadges.test.tsx +++ b/src/components/FilterBadges/FilterBadges.test.tsx @@ -6,7 +6,7 @@ describe("filterBadges", () => { const onRemove = jest.fn(); const onClearAll = jest.fn(); render( - + , ); expect(screen.queryAllByDataCy("filter-badge")).toHaveLength(0); }); @@ -17,7 +17,7 @@ describe("filterBadges", () => { badges={[{ key: "test", value: "value" }]} onRemove={jest.fn()} onClearAll={jest.fn()} - /> + />, ); expect(screen.queryAllByDataCy("filter-badge")).toHaveLength(1); expect(screen.getByText("test: value")).toBeInTheDocument(); @@ -32,7 +32,7 @@ describe("filterBadges", () => { ]} onRemove={jest.fn()} onClearAll={jest.fn()} - /> + />, ); expect(screen.queryAllByDataCy("filter-badge")).toHaveLength(2); expect(screen.getByText("test: value")).toBeInTheDocument(); @@ -56,7 +56,7 @@ describe("filterBadges", () => { ]} onRemove={jest.fn()} onClearAll={jest.fn()} - /> + />, ); expect(screen.queryAllByDataCy("filter-badge")).toHaveLength(8); expect(screen.getByText("test: value")).toBeInTheDocument(); @@ -82,20 +82,20 @@ describe("filterBadges", () => { ]} onRemove={jest.fn()} onClearAll={jest.fn()} - /> + />, ); await user.click(screen.queryByText("see 2 more")); expect(screen.getByDataCy("see-more-modal")).toBeInTheDocument(); expect( within(screen.queryByDataCy("see-more-modal")).queryAllByDataCy( - "filter-badge" - ) + "filter-badge", + ), ).toHaveLength(10); for (let i = 0; i < 10; i++) { expect( within(screen.getByDataCy("see-more-modal")).getByText( - `test${i + 1}: value${i + 1}` - ) + `test${i + 1}: value${i + 1}`, + ), ).toBeInTheDocument(); } }); @@ -119,7 +119,7 @@ describe("filterBadges", () => { ]} onRemove={jest.fn()} onClearAll={onClearAll} - /> + />, ); await user.click(screen.getByRole("button", { name: "CLEAR ALL FILTERS" })); expect(onClearAll).toHaveBeenCalledTimes(1); @@ -144,7 +144,7 @@ describe("filterBadges", () => { ]} onRemove={onRemove} onClearAll={jest.fn()} - /> + />, ); const closeBadge = screen.queryAllByDataCy("close-badge")[0]; expect(closeBadge).toBeInTheDocument(); @@ -160,7 +160,7 @@ describe("filterBadges", () => { badges={[{ key: "some", value: longName }]} onRemove={jest.fn()} onClearAll={jest.fn()} - /> + />, ); const truncatedBadge = screen.queryByDataCy("filter-badge"); expect(truncatedBadge).toBeInTheDocument(); diff --git a/src/components/FilterBadges/useFilterBadgeQueryParams.test.tsx b/src/components/FilterBadges/useFilterBadgeQueryParams.test.tsx index dc4ab3b1e3..9bc44d6b56 100644 --- a/src/components/FilterBadges/useFilterBadgeQueryParams.test.tsx +++ b/src/components/FilterBadges/useFilterBadgeQueryParams.test.tsx @@ -9,7 +9,7 @@ const Content = () => { ProjectFilterOptions.BuildVariant, ProjectFilterOptions.Test, ProjectFilterOptions.Task, - ]) + ]), ); return ( ) => { const { search } = location; const queryParams = parseQueryString(search); const queryParamsList = convertObjectToArray(queryParams).filter(({ key }) => - validQueryParams.has(key as string) + validQueryParams.has(key as string), ); const handleClearAll = () => { diff --git a/src/components/GroupedTaskStatusBadge/GroupedTaskStatusBadge.test.tsx b/src/components/GroupedTaskStatusBadge/GroupedTaskStatusBadge.test.tsx index 59e317231f..3a202e05f5 100644 --- a/src/components/GroupedTaskStatusBadge/GroupedTaskStatusBadge.test.tsx +++ b/src/components/GroupedTaskStatusBadge/GroupedTaskStatusBadge.test.tsx @@ -24,7 +24,7 @@ describe("groupedTaskStatusBadgeIcon", () => { { path: "/version/:versionId/:tab", route: `/version/${versionId}/tasks`, - } + }, ); const badge = screen.queryByDataCy("grouped-task-status-badge"); expect(badge).toBeInTheDocument(); @@ -38,7 +38,7 @@ describe("groupedTaskStatusBadgeIcon", () => { count={400} status={TaskStatus.SystemFailureUmbrella} href={`/version/${versionId}`} - /> + />, ); expect(screen.getByText("System Failed")).toBeInTheDocument(); expect(screen.getByText("400")).toBeInTheDocument(); @@ -52,11 +52,11 @@ describe("groupedTaskStatusBadgeIcon", () => { href={getVersionRoute(versionId, { statuses: [TaskStatus.SystemFailed], })} - /> + />, ); expect(screen.queryByDataCy("grouped-task-status-badge")).toHaveAttribute( "href", - `/version/${versionId}/tasks?statuses=system-failed` + `/version/${versionId}/tasks?statuses=system-failed`, ); }); @@ -73,17 +73,17 @@ describe("groupedTaskStatusBadgeIcon", () => { status={TaskStatus.SystemFailureUmbrella} href={`/version/${versionId}`} statusCounts={statusCounts} - /> + />, ); await waitFor(() => { expect( - screen.queryByDataCy("grouped-task-status-badge-tooltip") + screen.queryByDataCy("grouped-task-status-badge-tooltip"), ).toBeNull(); }); await user.hover(screen.queryByDataCy("grouped-task-status-badge")); await waitFor(() => { expect( - screen.getByDataCy("grouped-task-status-badge-tooltip") + screen.getByDataCy("grouped-task-status-badge-tooltip"), ).toBeVisible(); }); expect(screen.queryByText("30")).toBeVisible(); diff --git a/src/components/Header/NavDropdown/NavDropdown.test.tsx b/src/components/Header/NavDropdown/NavDropdown.test.tsx index d1cfbfb907..c8ec27bf91 100644 --- a/src/components/Header/NavDropdown/NavDropdown.test.tsx +++ b/src/components/Header/NavDropdown/NavDropdown.test.tsx @@ -33,11 +33,11 @@ describe("navDropdown", () => { expect(screen.getByText("Item 1")).toBeInTheDocument(); expect(screen.getByText("Item 1").closest("a")).toHaveAttribute( "href", - "/item1" + "/item1", ); expect(screen.getByText("Item 2").closest("a")).toHaveAttribute( "href", - "/item2" + "/item2", ); }); it("clicking on a link triggers a callback", async () => { @@ -54,7 +54,7 @@ describe("navDropdown", () => { onClick: mockCallback, }, ]} - /> + />, ); await user.click(screen.getByText("Dropdown")); expect(screen.getByText("Item 1")).toBeInTheDocument(); diff --git a/src/components/HistoryTable/Cell/Cell.test.tsx b/src/components/HistoryTable/Cell/Cell.test.tsx index 0217c95474..6181979bf8 100644 --- a/src/components/HistoryTable/Cell/Cell.test.tsx +++ b/src/components/HistoryTable/Cell/Cell.test.tsx @@ -11,7 +11,7 @@ describe("taskCell", () => { status: TaskStatus.Succeeded, }} loading={false} - /> + />, ); expect(screen.getByLabelText("Checkmark Icon")).toBeInTheDocument(); @@ -24,7 +24,7 @@ describe("taskCell", () => { status: TaskStatus.Failed, }} loading={false} - /> + />, ); expect(screen.getByLabelText("Failure Icon")).toBeInTheDocument(); expect(screen.getByDataCy("task-cell")).toBeInTheDocument(); @@ -38,11 +38,11 @@ describe("taskCell", () => { status: TaskStatus.Succeeded, }} loading={false} - /> + />, ); expect(screen.queryByRole("link")).toHaveAttribute( "href", - "/task/some-task-id" + "/task/some-task-id", ); }); @@ -55,7 +55,7 @@ describe("taskCell", () => { }} inactive loading={false} - /> + />, ); expect(screen.queryByDataCy("task-cell")).toHaveStyle("opacity: 0.4"); }); @@ -68,7 +68,7 @@ describe("taskCell", () => { status: TaskStatus.Failed, }} label="some-label" - /> + />, ); expect(screen.getByText("some-label")).toBeInTheDocument(); }); @@ -83,7 +83,7 @@ describe("taskCell", () => { }} failingTests={["some-test"]} loading={false} - /> + />, ); await user.hover(screen.queryByDataCy("history-table-icon")); await screen.findByText("some-test"); diff --git a/src/components/HistoryTable/HistoryTable.stories.tsx b/src/components/HistoryTable/HistoryTable.stories.tsx index 174364f8b7..5d02692e51 100644 --- a/src/components/HistoryTable/HistoryTable.stories.tsx +++ b/src/components/HistoryTable/HistoryTable.stories.tsx @@ -94,7 +94,7 @@ const generateNewCommitData = (oldData: typeof mainlineCommitData) => { newRolledUpVersion.order -= counter; counter += 1; return newRolledUpVersion; - } + }, ); } return newVersion; diff --git a/src/components/HistoryTable/HistoryTable.tsx b/src/components/HistoryTable/HistoryTable.tsx index f8bcbbbde8..d2ef62f56f 100644 --- a/src/components/HistoryTable/HistoryTable.tsx +++ b/src/components/HistoryTable/HistoryTable.tsx @@ -39,7 +39,7 @@ const HistoryTable: React.FC = ({ const size = useDimensions(ref); const throttledOnChangeTableWidth = useMemo( () => throttle(onChangeTableWidth, 400), - [onChangeTableWidth] + [onChangeTableWidth], ); useEffect(() => { @@ -55,7 +55,7 @@ const HistoryTable: React.FC = ({ { selectedCommit, }, - SentryBreadcrumb.UI + SentryBreadcrumb.UI, ); listRef.current.scrollToIndex(selectedCommit.rowIndex); } @@ -71,7 +71,7 @@ const HistoryTable: React.FC = ({ selectedCommit, processedCommitCount, }, - SentryBreadcrumb.UI + SentryBreadcrumb.UI, ); loadMoreItems(); } diff --git a/src/components/HistoryTable/HistoryTableContext.test.tsx b/src/components/HistoryTable/HistoryTableContext.test.tsx index 7456505433..33fe159043 100644 --- a/src/components/HistoryTable/HistoryTableContext.test.tsx +++ b/src/components/HistoryTable/HistoryTableContext.test.tsx @@ -45,11 +45,11 @@ describe("historyTableContext", () => { }); // Filter out the column date separators const processedCommits = result.current.processedCommits.filter( - (c) => c.type !== rowType.DATE_SEPARATOR + (c) => c.type !== rowType.DATE_SEPARATOR, ); // Should have processed the new commits and have every real commit expect(processedCommits).toHaveLength( - splitMainlineCommitDataPart1.versions.length + splitMainlineCommitDataPart1.versions.length, ); // First element should be the date separator expect(result.current.isItemLoaded(0)).toBe(true); diff --git a/src/components/HistoryTable/HistoryTableContext.tsx b/src/components/HistoryTable/HistoryTableContext.tsx index 3ed2dc70f1..c5553862fd 100644 --- a/src/components/HistoryTable/HistoryTableContext.tsx +++ b/src/components/HistoryTable/HistoryTableContext.tsx @@ -48,7 +48,7 @@ interface HistoryTableState { } const HistoryTableDispatchContext = createContext( - null + null, ); interface HistoryTableProviderProps { children: React.ReactNode; @@ -112,7 +112,7 @@ const HistoryTableProvider: React.FC = ({ addColumns: (columns: string[]) => dispatch({ type: "addColumns", columns }), ingestNewCommits: ( - commits: MainlineCommitsForHistoryQuery["mainlineCommits"] + commits: MainlineCommitsForHistoryQuery["mainlineCommits"], ) => dispatch({ type: "ingestNewCommits", commits }), markSelectedRowVisited: () => dispatch({ type: "markSelectedRowVisited" }), @@ -132,7 +132,7 @@ const HistoryTableProvider: React.FC = ({ }, }), // eslint-disable-next-line react-hooks/exhaustive-deps - [visibleColumns, processedCommitCount, historyTableFilters] + [visibleColumns, processedCommitCount, historyTableFilters], ); return ( @@ -146,7 +146,7 @@ const useHistoryTable = () => { const context = useContext(HistoryTableDispatchContext); if (context === undefined) { throw new Error( - "useHistoryTable must be used within a HistoryTableProvider" + "useHistoryTable must be used within a HistoryTableProvider", ); } return context; diff --git a/src/components/HistoryTable/HistoryTableIcon/HistoryTableIcon.test.tsx b/src/components/HistoryTable/HistoryTableIcon/HistoryTableIcon.test.tsx index 3328db1067..d2b881b73f 100644 --- a/src/components/HistoryTable/HistoryTableIcon/HistoryTableIcon.test.tsx +++ b/src/components/HistoryTable/HistoryTableIcon/HistoryTableIcon.test.tsx @@ -7,7 +7,7 @@ describe("historyTableIcon", () => { const user = userEvent.setup(); const onClick = jest.fn(); render( - + , ); const icon = screen.queryByDataCy("history-table-icon"); expect(icon).toBeInTheDocument(); @@ -30,7 +30,7 @@ describe("historyTableIcon", () => { + />, ); const icon = screen.queryByDataCy("history-table-icon"); expect(icon).toBeInTheDocument(); diff --git a/src/components/HistoryTable/HistoryTableRow/BaseRow/FoldedCommit/FoldedCommit.test.tsx b/src/components/HistoryTable/HistoryTableRow/BaseRow/FoldedCommit/FoldedCommit.test.tsx index 6739e181c7..9b22b8a468 100644 --- a/src/components/HistoryTable/HistoryTableRow/BaseRow/FoldedCommit/FoldedCommit.test.tsx +++ b/src/components/HistoryTable/HistoryTableRow/BaseRow/FoldedCommit/FoldedCommit.test.tsx @@ -22,7 +22,7 @@ describe("foldedCommit", () => { numVisibleCols={5} selected={false} /> - + , ); expect(screen.getByText("Expand 5 inactive")).toBeInTheDocument(); expect(screen.queryByText("Collapse 5 inactive")).toBeNull(); @@ -46,7 +46,7 @@ describe("foldedCommit", () => { numVisibleCols={5} selected={false} /> - + , ); await user.click(screen.queryByText("Expand 5 inactive")); expect(screen.queryByText("Expand 5 inactive")).toBeNull(); diff --git a/src/components/HistoryTable/HistoryTableRow/BaseRow/FoldedCommit/index.tsx b/src/components/HistoryTable/HistoryTableRow/BaseRow/FoldedCommit/index.tsx index 293bc9149d..54933d8d90 100644 --- a/src/components/HistoryTable/HistoryTableRow/BaseRow/FoldedCommit/index.tsx +++ b/src/components/HistoryTable/HistoryTableRow/BaseRow/FoldedCommit/index.tsx @@ -43,7 +43,7 @@ const FoldedCommit: React.FC = ({ Array.from(Array(numVisibleCols)).map((_, idx) => ( // eslint-disable-line react/no-array-index-key )), - [numVisibleCols] + [numVisibleCols], ); const commits = rolledUpCommits.map((commit) => ( diff --git a/src/components/HistoryTable/HistoryTableRow/BaseRow/styles.ts b/src/components/HistoryTable/HistoryTableRow/BaseRow/styles.ts index 7f2847bfac..82cb7e3b04 100644 --- a/src/components/HistoryTable/HistoryTableRow/BaseRow/styles.ts +++ b/src/components/HistoryTable/HistoryTableRow/BaseRow/styles.ts @@ -21,6 +21,8 @@ export const DashedLine = styled.div` height: 1px; background: linear-gradient(to right, transparent 50%, white 50%), linear-gradient(to right, ${gray.light1}, ${gray.light1}); - background-size: ${size.s} 2px, 100% 2px; + background-size: + ${size.s} 2px, + 100% 2px; width: 100%; `; diff --git a/src/components/HistoryTable/HistoryTableTestSearch/HistoryTableTestSearch.stories.tsx b/src/components/HistoryTable/HistoryTableTestSearch/HistoryTableTestSearch.stories.tsx index 034896287d..c7a3a20e97 100644 --- a/src/components/HistoryTable/HistoryTableTestSearch/HistoryTableTestSearch.stories.tsx +++ b/src/components/HistoryTable/HistoryTableTestSearch/HistoryTableTestSearch.stories.tsx @@ -17,7 +17,7 @@ export const Default: CustomStoryObj = { const TestSearch = () => { const { badges, handleClearAll, handleOnRemove } = useFilterBadgeQueryParams( - new Set([TestStatus.Failed, TestStatus.Passed, TestStatus.All]) + new Set([TestStatus.Failed, TestStatus.Passed, TestStatus.All]), ); return ( diff --git a/src/components/HistoryTable/HistoryTableTestSearch/HistoryTableTestSearch.test.tsx b/src/components/HistoryTable/HistoryTableTestSearch/HistoryTableTestSearch.test.tsx index 0c9db75e37..3314a70747 100644 --- a/src/components/HistoryTable/HistoryTableTestSearch/HistoryTableTestSearch.test.tsx +++ b/src/components/HistoryTable/HistoryTableTestSearch/HistoryTableTestSearch.test.tsx @@ -9,7 +9,7 @@ describe("historyTableTestSearch", () => { path: "/variant-history/:projectId/:variantName", }); const input = screen.getByPlaceholderText( - "Search test name regex" + "Search test name regex", ) as HTMLInputElement; expect(input).toBeInTheDocument(); expect(input).toHaveValue(""); @@ -22,7 +22,7 @@ describe("historyTableTestSearch", () => { path: "/variant-history/:projectId/:variantName", }); const input = screen.getByPlaceholderText( - "Search test name regex" + "Search test name regex", ) as HTMLInputElement; expect(input).toHaveValue(""); @@ -39,7 +39,7 @@ describe("historyTableTestSearch", () => { path: "/variant-history/:projectId/:variantName", }); const input = screen.getByPlaceholderText( - "Search test name regex" + "Search test name regex", ) as HTMLInputElement; // FAILED TEST @@ -57,7 +57,7 @@ describe("historyTableTestSearch", () => { path: "/variant-history/:projectId/:variantName", }); const input = screen.getByPlaceholderText( - "Search test name regex" + "Search test name regex", ) as HTMLInputElement; expect(input).toHaveValue(""); await user.type(input, "some-test-name"); @@ -67,7 +67,7 @@ describe("historyTableTestSearch", () => { expect(input).toHaveValue("some-other-test-name"); await user.type(input, "{enter}"); expect(router.state.location.search).toBe( - `?failed=some-test-name,some-other-test-name` + `?failed=some-test-name,some-other-test-name`, ); }); @@ -78,7 +78,7 @@ describe("historyTableTestSearch", () => { path: "/variant-history/:projectId/:variantName", }); const input = screen.getByPlaceholderText( - "Search test name regex" + "Search test name regex", ) as HTMLInputElement; expect(input).toHaveValue(""); await user.type(input, "some-test-name"); diff --git a/src/components/HistoryTable/historyTableContextReducer.ts b/src/components/HistoryTable/historyTableContextReducer.ts index b10add2b7c..5291bc0d96 100644 --- a/src/components/HistoryTable/historyTableContextReducer.ts +++ b/src/components/HistoryTable/historyTableContextReducer.ts @@ -58,7 +58,7 @@ export const reducer = (state: HistoryTableReducerState, action: Action) => { // This also performantly handles deduplication of commits at the expense of memory const updatedObjectCache = objectifyCommits( state.commitCache, - action.commits.versions + action.commits.versions, ); if (updatedObjectCache.size > state.commitCache.size) { // Check if our selected commit has been loaded @@ -115,7 +115,7 @@ export const reducer = (state: HistoryTableReducerState, action: Action) => { const nextPage = state.currentPage + 1; const nextPageColumns = state.columns.slice( state.columnLimit * nextPage, - state.columnLimit * (nextPage + 1) + state.columnLimit * (nextPage + 1), ); return { ...state, @@ -142,7 +142,7 @@ export const reducer = (state: HistoryTableReducerState, action: Action) => { } const prevPageColumns = state.columns.slice( state.columnLimit * (state.currentPage - 1), - state.columnLimit * state.currentPage + state.columnLimit * state.currentPage, ); return { ...state, @@ -169,7 +169,7 @@ export const reducer = (state: HistoryTableReducerState, action: Action) => { const hasMatchingCommit = state.commitCache.has(action.order); if (hasMatchingCommit) { rowIndex = state.processedCommits.findIndex((commit) => - commitOrderToRowIndex(action.order, commit) + commitOrderToRowIndex(action.order, commit), ); updatedProcessedCommits[rowIndex].selected = true; loaded = true; @@ -194,7 +194,7 @@ export const reducer = (state: HistoryTableReducerState, action: Action) => { throw new Error( `Cannot expand row of type ${ updatedProcessedCommits[action.rowIndex].type - }` + }`, ); } else { row.expanded = action.expanded; @@ -214,7 +214,7 @@ export const reducer = (state: HistoryTableReducerState, action: Action) => { // This is used to performantly track if we have seen a commit before and avoid duplicating it const objectifyCommits = ( cache: cacheShape, - newCommits: mainlineCommits["versions"] + newCommits: mainlineCommits["versions"], ) => { const obj = new Map(cache); newCommits.forEach((commit) => { diff --git a/src/components/HistoryTable/hooks/useColumns.ts b/src/components/HistoryTable/hooks/useColumns.ts index 4d793fdd21..5132c045a8 100644 --- a/src/components/HistoryTable/hooks/useColumns.ts +++ b/src/components/HistoryTable/hooks/useColumns.ts @@ -11,30 +11,30 @@ const useColumns = (allColumns: T[], accessFunc: (column: T) => string) => { const { search } = useLocation(); const { [HistoryQueryParams.VisibleColumns]: queryParams } = useMemo( () => parseQueryString(search), - [search] + [search], ); const { addColumns } = useHistoryTable(); const selectedColumnsInQuery = useMemo( () => toArray(queryParams), - [queryParams] + [queryParams], ); const activeColumns = useMemo( () => selectedColumnsInQuery.length ? allColumns?.filter((column) => - selectedColumnsInQuery.includes(accessFunc(column)) + selectedColumnsInQuery.includes(accessFunc(column)), ) : allColumns, // eslint-disable-next-line react-hooks/exhaustive-deps - [selectedColumnsInQuery, allColumns] + [selectedColumnsInQuery, allColumns], ); const visibleColumns = useMemo( () => activeColumns?.map((column) => accessFunc(column)) ?? [], // eslint-disable-next-line react-hooks/exhaustive-deps - [activeColumns] + [activeColumns], ); useEffect(() => { diff --git a/src/components/HistoryTable/hooks/useJumpToCommit.ts b/src/components/HistoryTable/hooks/useJumpToCommit.ts index abb18ad404..525f712dd8 100644 --- a/src/components/HistoryTable/hooks/useJumpToCommit.ts +++ b/src/components/HistoryTable/hooks/useJumpToCommit.ts @@ -10,7 +10,7 @@ const useJumpToCommit = () => { const { search } = useLocation(); const { [HistoryQueryParams.SelectedCommit]: skipOrderNumberParam } = useMemo( () => parseQueryString(search), - [search] + [search], ); const skipOrderNumber = parseInt(getString(skipOrderNumberParam), 10) || undefined; diff --git a/src/components/HistoryTable/hooks/useTestResults.test.tsx b/src/components/HistoryTable/hooks/useTestResults.test.tsx index 3c34658313..3f9ca36e87 100644 --- a/src/components/HistoryTable/hooks/useTestResults.test.tsx +++ b/src/components/HistoryTable/hooks/useTestResults.test.tsx @@ -28,8 +28,8 @@ describe("useTestResults", () => { }); expect( result.current.hookResponse.getTaskMetadata( - "evergreen_ubuntu1604_dist_d4cf298cf0b2536fb3bff875775b93a9ceafb75c_21_09_02_14_20_04" - ) + "evergreen_ubuntu1604_dist_d4cf298cf0b2536fb3bff875775b93a9ceafb75c_21_09_02_14_20_04", + ), ).toMatchObject({ inactive: false, label: "", @@ -42,7 +42,7 @@ describe("useTestResults", () => { wrapper: ({ children }) => ProviderWrapper({ children, mocks }), }); expect( - result.current.hookResponse.getTaskMetadata("some_id") + result.current.hookResponse.getTaskMetadata("some_id"), ).toMatchObject({ inactive: false, label: "", @@ -56,7 +56,7 @@ describe("useTestResults", () => { type: rowType.DATE_SEPARATOR, }); expect( - result.current.hookResponse.getTaskMetadata("some_id") + result.current.hookResponse.getTaskMetadata("some_id"), ).toMatchObject({ inactive: false, label: "", @@ -70,8 +70,8 @@ describe("useTestResults", () => { }); expect( result.current.hookResponse.getTaskMetadata( - "evergreen_ubuntu1604_dist_d4cf298cf0b2536fb3bff875775b93a9ceafb75c_21_09_02_14_20_04" - ) + "evergreen_ubuntu1604_dist_d4cf298cf0b2536fb3bff875775b93a9ceafb75c_21_09_02_14_20_04", + ), ).toMatchObject({ inactive: false, label: "", @@ -87,8 +87,8 @@ describe("useTestResults", () => { await waitFor(() => { expect( result.current.hookResponse.getTaskMetadata( - "evergreen_ubuntu1604_dist_d4cf298cf0b2536fb3bff875775b93a9ceafb75c_21_09_02_14_20_04" - ) + "evergreen_ubuntu1604_dist_d4cf298cf0b2536fb3bff875775b93a9ceafb75c_21_09_02_14_20_04", + ), ).toMatchObject({ inactive: false, label: "", @@ -104,8 +104,8 @@ describe("useTestResults", () => { }); expect( result.current.hookResponse.getTaskMetadata( - "evergreen_ubuntu1604_dist_d4cf298cf0b2536fb3bff875775b93a9ceafb75c_21_09_02_14_20_04" - ) + "evergreen_ubuntu1604_dist_d4cf298cf0b2536fb3bff875775b93a9ceafb75c_21_09_02_14_20_04", + ), ).toMatchObject({ inactive: false, label: "", @@ -127,8 +127,8 @@ describe("useTestResults", () => { await waitFor(() => { expect( result.current.hookResponse.getTaskMetadata( - "evergreen_ubuntu1604_dist_d4cf298cf0b2536fb3bff875775b93a9ceafb75c_21_09_02_14_20_04" - ) + "evergreen_ubuntu1604_dist_d4cf298cf0b2536fb3bff875775b93a9ceafb75c_21_09_02_14_20_04", + ), ).toMatchObject({ inactive: false, label: "1 / 1 Failing Tests", @@ -144,8 +144,8 @@ describe("useTestResults", () => { }); expect( result.current.hookResponse.getTaskMetadata( - "evergreen_ubuntu1604_dist_d4cf298cf0b2536fb3bff875775b93a9ceafb75c_21_09_02_14_20_04" - ) + "evergreen_ubuntu1604_dist_d4cf298cf0b2536fb3bff875775b93a9ceafb75c_21_09_02_14_20_04", + ), ).toMatchObject({ inactive: false, label: "", @@ -166,8 +166,8 @@ describe("useTestResults", () => { await waitFor(() => { expect( result.current.hookResponse.getTaskMetadata( - "evergreen_ubuntu1604_dist_d4cf298cf0b2536fb3bff875775b93a9ceafb75c_21_09_02_14_20_04" - ) + "evergreen_ubuntu1604_dist_d4cf298cf0b2536fb3bff875775b93a9ceafb75c_21_09_02_14_20_04", + ), ).toMatchObject({ inactive: true, label: "0 / 1 Failing Tests", diff --git a/src/components/HistoryTable/hooks/useTestResults.ts b/src/components/HistoryTable/hooks/useTestResults.ts index ae152d7e0c..cb412d94a3 100644 --- a/src/components/HistoryTable/hooks/useTestResults.ts +++ b/src/components/HistoryTable/hooks/useTestResults.ts @@ -28,7 +28,7 @@ const useTestResults = (rowIndex: number) => { const commit = getItem(rowIndex); if (commit && commit.type === rowType.COMMIT && commit.commit) { taskIds = commit.commit.buildVariants.flatMap((buildVariant) => - buildVariant.tasks.map((task) => task.id) + buildVariant.tasks.map((task) => task.id), ); } const hasDataToQuery = taskIds.length > 0; @@ -72,7 +72,7 @@ const useTestResults = (rowIndex: number) => { failingTests: [], }; }, - [hasTestFilters, loading, taskTestMap] + [hasTestFilters, loading, taskTestMap], ); return { getTaskMetadata }; diff --git a/src/components/HistoryTable/utils.ts b/src/components/HistoryTable/utils.ts index 1f8e06ddde..0ce869edb3 100644 --- a/src/components/HistoryTable/utils.ts +++ b/src/components/HistoryTable/utils.ts @@ -61,7 +61,7 @@ export const processCommits = ({ const firstRolledUpVersion = rolledUpVersions[0]; const selected = hasSelectedCommit( rolledUpVersions, - selectedCommitOrder + selectedCommitOrder, ); if ( priorCommit && @@ -123,19 +123,19 @@ const isSameDay = (date1: string | Date, date2: string | Date) => { const hasSelectedCommit = ( rolledUpUpVersions: Unpacked["rolledUpVersions"], - selectedCommitOrder: number | null + selectedCommitOrder: number | null, ) => { if (selectedCommitOrder === null) { return false; } return rolledUpUpVersions.some( - (version) => version.order === selectedCommitOrder + (version) => version.order === selectedCommitOrder, ); }; export const calcColumnLimitFromWidth = (tableWidth: number) => { const colLimit = Math.floor( - (tableWidth - ROW_LABEL_WIDTH) / COLUMN_LABEL_WIDTH + (tableWidth - ROW_LABEL_WIDTH) / COLUMN_LABEL_WIDTH, ); return Math.max(colLimit, 1); }; diff --git a/src/components/Hosts/UpdateStatusModal.tsx b/src/components/Hosts/UpdateStatusModal.tsx index 8cd2332d97..56312c7e6c 100644 --- a/src/components/Hosts/UpdateStatusModal.tsx +++ b/src/components/Hosts/UpdateStatusModal.tsx @@ -62,7 +62,7 @@ export const UpdateStatusModal: React.FC = ({ onError(error) { closeModal(); dispatchToast.error( - `There was an error updating hosts status: ${error.message}` + `There was an error updating hosts status: ${error.message}`, ); }, refetchQueries: ["Hosts"], diff --git a/src/components/LinkToReconfigurePage.tsx b/src/components/LinkToReconfigurePage.tsx index 8ce6961a66..5511742a17 100644 --- a/src/components/LinkToReconfigurePage.tsx +++ b/src/components/LinkToReconfigurePage.tsx @@ -9,7 +9,7 @@ export const LinkToReconfigurePage: React.FC<{ hasVersion?: boolean; }> = ({ disabled, hasVersion = true, patchId }) => { const { sendEvent } = (hasVersion ? useVersionAnalytics : usePatchAnalytics)( - patchId + patchId, ); const navigate = useNavigate(); diff --git a/src/components/Notifications/form/event.ts b/src/components/Notifications/form/event.ts index d424746f7a..e3e2300dc9 100644 --- a/src/components/Notifications/form/event.ts +++ b/src/components/Notifications/form/event.ts @@ -80,7 +80,7 @@ const failureSelect = { const regexSelector = ( regexEnumsToDisable: string[], - regexSelectors: RegexSelector[] + regexSelectors: RegexSelector[], ) => ({ type: "array" as "array", minItems: 0, @@ -123,7 +123,7 @@ const regexSelector = ( */ export const getEventSchema = ( regexEnumsToDisable: string[], - triggers: Trigger + triggers: Trigger, ): { schema: SpruceFormProps["schema"]; uiSchema: SpruceFormProps["uiSchema"]; @@ -236,7 +236,7 @@ export const getEventSchema = ( }, regexSelector: regexSelector( regexEnumsToDisable, - buildRegexSelectors + buildRegexSelectors, ), }, }, @@ -278,7 +278,7 @@ export const getEventSchema = ( }, regexSelector: regexSelector( regexEnumsToDisable, - buildRegexSelectors + buildRegexSelectors, ), }, }, @@ -302,7 +302,7 @@ export const getEventSchema = ( }, regexSelector: regexSelector( regexEnumsToDisable, - taskRegexSelectors + taskRegexSelectors, ), }, }, @@ -325,7 +325,7 @@ export const getEventSchema = ( }, regexSelector: regexSelector( regexEnumsToDisable, - taskRegexSelectors + taskRegexSelectors, ), }, }, @@ -348,7 +348,7 @@ export const getEventSchema = ( }, regexSelector: regexSelector( regexEnumsToDisable, - taskRegexSelectors + taskRegexSelectors, ), }, }, @@ -373,7 +373,7 @@ export const getEventSchema = ( }, regexSelector: regexSelector( regexEnumsToDisable, - taskRegexSelectors + taskRegexSelectors, ), }, }, @@ -395,7 +395,7 @@ export const getEventSchema = ( }, regexSelector: regexSelector( regexEnumsToDisable, - taskRegexSelectors + taskRegexSelectors, ), }, }, @@ -414,7 +414,7 @@ export const getEventSchema = ( }, regexSelector: regexSelector( regexEnumsToDisable, - taskRegexSelectors + taskRegexSelectors, ), }, }, diff --git a/src/components/Notifications/form/getFormSchema.ts b/src/components/Notifications/form/getFormSchema.ts index 1c08b9d488..d4575eeef2 100644 --- a/src/components/Notifications/form/getFormSchema.ts +++ b/src/components/Notifications/form/getFormSchema.ts @@ -7,14 +7,14 @@ import { getNotificationSchema } from "./notification"; export const getFormSchema = ( regexEnumsToDisable: string[], triggers: Trigger, - subscriptionMethods: SubscriptionMethodOption[] + subscriptionMethods: SubscriptionMethodOption[], ): { schema: SpruceFormProps["schema"]; uiSchema: SpruceFormProps["uiSchema"]; } => { const { schema: eventSchema, uiSchema: eventUiSchema } = getEventSchema( regexEnumsToDisable, - triggers + triggers, ); const { schema: notificationSchema, uiSchema: notificationUiSchema } = getNotificationSchema(subscriptionMethods); diff --git a/src/components/Notifications/form/notification.ts b/src/components/Notifications/form/notification.ts index 2928c2799f..b9a0f7d922 100644 --- a/src/components/Notifications/form/notification.ts +++ b/src/components/Notifications/form/notification.ts @@ -13,7 +13,7 @@ import { * @returns - an object containing the schema and uiSchema for the notification section of subscriptions. */ export const getNotificationSchema = ( - subscriptionMethods: SubscriptionMethodOption[] + subscriptionMethods: SubscriptionMethodOption[], ): { schema: SpruceFormProps["schema"]; uiSchema: SpruceFormProps["uiSchema"]; diff --git a/src/components/Notifications/index.tsx b/src/components/Notifications/index.tsx index 91c1e08e6f..993795612b 100644 --- a/src/components/Notifications/index.tsx +++ b/src/components/Notifications/index.tsx @@ -31,7 +31,7 @@ interface NotificationModalProps { onCancel: (e?: React.MouseEvent) => void; resourceId: string; sendAnalyticsEvent: ( - subscription: SaveSubscriptionForUserMutationVariables["subscription"] + subscription: SaveSubscriptionForUserMutationVariables["subscription"], ) => void; subscriptionMethods: SubscriptionMethodOption[]; triggers: Trigger; @@ -115,7 +115,7 @@ export const NotificationModal: React.FC = ({ const { schema, uiSchema } = getFormSchema( getRegexEnumsToDisable(formState.event.regexSelector), triggers, - subscriptionMethods + subscriptionMethods, ); return ( diff --git a/src/components/Notifications/utils.test.ts b/src/components/Notifications/utils.test.ts index e76a3c9e66..5e4c727337 100644 --- a/src/components/Notifications/utils.test.ts +++ b/src/components/Notifications/utils.test.ts @@ -11,7 +11,7 @@ describe("getGqlPayload", () => { "task", taskTriggers, "task_id", - taskFormState + taskFormState, ); expect(payload).toStrictEqual({ owner_type: "person", @@ -35,7 +35,7 @@ describe("getGqlPayload", () => { "version", versionTriggers, "version_id", - versionFormState + versionFormState, ); expect(payload).toStrictEqual({ owner_type: "person", @@ -59,7 +59,7 @@ describe("getGqlPayload", () => { "project", waterfallTriggers, "project_id", - projectFormState + projectFormState, ); expect(payload).toStrictEqual({ owner_type: "person", @@ -92,7 +92,7 @@ describe("getGqlPayload", () => { "version", versionTriggers, "version_id", - omitFieldsFormState + omitFieldsFormState, ); expect(payload).toStrictEqual({ owner_type: "person", diff --git a/src/components/Notifications/utils.ts b/src/components/Notifications/utils.ts index 4f9df11bbf..bef6b502c4 100644 --- a/src/components/Notifications/utils.ts +++ b/src/components/Notifications/utils.ts @@ -22,7 +22,7 @@ const getTargetForMethod = (method: string) => { // from other dependencies to persist. const regexFormToGql = ( hasRegexSelectors: boolean, - regexForm: FormRegexSelector[] + regexForm: FormRegexSelector[], ) => hasRegexSelectors && regexForm ? regexForm.map((r) => ({ @@ -36,7 +36,7 @@ const regexFormToGql = ( // for data from other dependencies to persist. const extraFieldsFormToGql = ( extraFieldsToInclude: ExtraField[], - extraFieldsForm: FormExtraFields + extraFieldsForm: FormExtraFields, ): StringMap => { // If there are no extra fields for this trigger, just return. if (!extraFieldsToInclude) { @@ -53,7 +53,7 @@ export const getGqlPayload = ( type: "task" | "version" | "project", triggers: Trigger, resourceId: string, - formState: FormState + formState: FormState, ) => { const event = triggers[formState.event.eventSelect]; const { @@ -66,12 +66,12 @@ export const getGqlPayload = ( const triggerData = extraFieldsFormToGql( extraFields, - formState.event.extraFields + formState.event.extraFields, ); const regexData = regexFormToGql( !!regexSelectors, - formState.event.regexSelector + formState.event.regexSelector, ); const method = formState.notification.notificationSelect; diff --git a/src/components/PageSizeSelector/PageSizeSelector.test.tsx b/src/components/PageSizeSelector/PageSizeSelector.test.tsx index 8b157d2602..ea500b01c2 100644 --- a/src/components/PageSizeSelector/PageSizeSelector.test.tsx +++ b/src/components/PageSizeSelector/PageSizeSelector.test.tsx @@ -10,7 +10,7 @@ describe("pageSizeSelector", () => { data-cy="page-size-selector" value={10} onChange={onChange} - /> + />, ); await user.click(screen.getByRole("button", { name: "10 / page" })); expect(screen.queryByText("20 / page")).toBeVisible(); diff --git a/src/components/Pagination/Pagination.test.tsx b/src/components/Pagination/Pagination.test.tsx index cc7e22b6d0..6165a90588 100644 --- a/src/components/Pagination/Pagination.test.tsx +++ b/src/components/Pagination/Pagination.test.tsx @@ -4,7 +4,7 @@ import Pagination from "."; describe("pagination", () => { it("should render the correct page count given total results and page size", () => { const { rerender } = renderWithRouterMatch( - + , ); expect(screen.getByText("1 / 2")).toBeInTheDocument(); rerender(); @@ -16,28 +16,28 @@ describe("pagination", () => { }); it("shold disable the previous page if on the first page", () => { const { router } = renderWithRouterMatch( - + , ); expect(router.state.location.search).toBe(""); expect(screen.queryByDataCy("prev-page-button")).toHaveAttribute( "aria-disabled", - "true" + "true", ); }); it("should disable the next page if on the last page", () => { const { router } = renderWithRouterMatch( - + , ); expect(router.state.location.search).toBe(""); expect(screen.queryByDataCy("next-page-button")).toHaveAttribute( "aria-disabled", - "true" + "true", ); }); it("paginating forward should update the url with the new page number by default", async () => { const user = userEvent.setup(); const { router } = renderWithRouterMatch( - + , ); expect(router.state.location.search).toBe(""); @@ -47,7 +47,7 @@ describe("pagination", () => { it("paginating backward should update the url with the new page number by default", async () => { const user = userEvent.setup(); const { router } = renderWithRouterMatch( - + , ); expect(router.state.location.search).toBe(""); @@ -64,35 +64,35 @@ describe("pagination", () => { totalResults={10} pageSize={5} onChange={onChange} - /> + />, ); await user.click(screen.getByDataCy("next-page-button")); expect(onChange).toHaveBeenCalledWith(1); }); it("should disable pagination if there is only one page", () => { renderWithRouterMatch( - + , ); expect(screen.queryByDataCy("prev-page-button")).toHaveAttribute( "aria-disabled", - "true" + "true", ); expect(screen.queryByDataCy("next-page-button")).toHaveAttribute( "aria-disabled", - "true" + "true", ); }); it("should disable pagination if there are no pages", () => { renderWithRouterMatch( - + , ); expect(screen.queryByDataCy("prev-page-button")).toHaveAttribute( "aria-disabled", - "true" + "true", ); expect(screen.queryByDataCy("next-page-button")).toHaveAttribute( "aria-disabled", - "true" + "true", ); }); }); diff --git a/src/components/PatchActionButtons/UnscheduleTasks.tsx b/src/components/PatchActionButtons/UnscheduleTasks.tsx index afd813ef5c..f1f6a55397 100644 --- a/src/components/PatchActionButtons/UnscheduleTasks.tsx +++ b/src/components/PatchActionButtons/UnscheduleTasks.tsx @@ -38,7 +38,7 @@ export const UnscheduleTasks: React.FC = ({ dispatchToast.success( `All tasks were unscheduled ${ abort ? "and tasks that already started were aborted" : "" - }` + }`, ); setAbort(false); }, diff --git a/src/components/PatchesPage/PatchCard/index.tsx b/src/components/PatchesPage/PatchCard/index.tsx index c344f93905..129a8886bd 100644 --- a/src/components/PatchesPage/PatchCard/index.tsx +++ b/src/components/PatchesPage/PatchCard/index.tsx @@ -60,7 +60,7 @@ export const PatchCard: React.FC = ({ const getDateCopy = useDateFormat(); const { id: versionId, taskStatusStats } = versionFull || {}; const { stats } = groupStatusesByUmbrellaStatus( - taskStatusStats?.counts ?? [] + taskStatusStats?.counts ?? [], ); const isUnconfigured = isPatchUnconfigured({ alias, activated }); let patchProject = null; diff --git a/src/components/PatchesPage/index.tsx b/src/components/PatchesPage/index.tsx index 64d85668a6..802a8cf1d3 100644 --- a/src/components/PatchesPage/index.tsx +++ b/src/components/PatchesPage/index.tsx @@ -57,12 +57,12 @@ export const PatchesPage: React.FC = ({ const [isCommitQueueCheckboxChecked, setIsCommitQueueCheckboxChecked] = useQueryParam( PatchPageQueryParams.CommitQueue, - Cookies.get(cookie) === "true" + Cookies.get(cookie) === "true", ); const [includeHiddenCheckboxChecked, setIsIncludeHiddenCheckboxChecked] = useQueryParam( PatchPageQueryParams.Hidden, - Cookies.get(INCLUDE_HIDDEN_PATCHES) === "true" + Cookies.get(INCLUDE_HIDDEN_PATCHES) === "true", ); const { limit, page } = usePatchesQueryParams(); const { inputValue, setAndSubmitInputValue } = useFilterInputChangeHandler({ @@ -74,7 +74,7 @@ export const PatchesPage: React.FC = ({ usePageTitle(pageTitle); const commitQueueCheckboxOnChange = ( - e: React.ChangeEvent + e: React.ChangeEvent, ): void => { setIsCommitQueueCheckboxChecked(e.target.checked); Cookies.set(cookie, e.target.checked ? "true" : "false"); @@ -82,7 +82,7 @@ export const PatchesPage: React.FC = ({ }; const includeHiddenCheckboxOnChange = ( - e: React.ChangeEvent + e: React.ChangeEvent, ): void => { setIsIncludeHiddenCheckboxChecked(e.target.checked); Cookies.set(INCLUDE_HIDDEN_PATCHES, e.target.checked ? "true" : "false"); diff --git a/src/components/PatchesPage/usePatchesQueryParams.ts b/src/components/PatchesPage/usePatchesQueryParams.ts index fa5de986bb..3bee8db8d5 100644 --- a/src/components/PatchesPage/usePatchesQueryParams.ts +++ b/src/components/PatchesPage/usePatchesQueryParams.ts @@ -20,7 +20,7 @@ export const usePatchesQueryParams = (): Omit< const [patchName] = useQueryParam(PatchPageQueryParams.PatchName, ""); const [rawStatuses] = useQueryParam( PatchPageQueryParams.Statuses, - [] + [], ); const [hidden] = useQueryParam(PatchPageQueryParams.Hidden, false); const statuses = rawStatuses.filter((v) => v && v !== ALL_PATCH_STATUS); diff --git a/src/components/Popconfirm/Popconfirm.test.tsx b/src/components/Popconfirm/Popconfirm.test.tsx index 4c6a3a7b51..ce191c1179 100644 --- a/src/components/Popconfirm/Popconfirm.test.tsx +++ b/src/components/Popconfirm/Popconfirm.test.tsx @@ -6,7 +6,7 @@ describe("controlled popconfirm", () => { render(
hello
-
+ , ); expect(screen.getByText("hello")).toBeInTheDocument(); expect(screen.getByRole("button", { name: "OK" })).toBeInTheDocument(); @@ -20,7 +20,7 @@ describe("controlled popconfirm", () => { render(
hello
-
+ , ); await user.click(screen.getByRole("button", { name: "Yes" })); expect(onConfirm).toHaveBeenCalledTimes(1); @@ -35,7 +35,7 @@ describe("controlled popconfirm", () => { render(
hello
-
+ , ); await user.click(screen.getByRole("button", { name: "Cancel" })); expect(onClose).toHaveBeenCalledTimes(1); @@ -47,11 +47,11 @@ describe("controlled popconfirm", () => { render(
hello
-
+ , ); expect(screen.getByRole("button", { name: "Yes" })).toHaveAttribute( "aria-disabled", - "true" + "true", ); }); }); @@ -66,7 +66,7 @@ describe("uncontrolled popconfirm", () => { trigger={} >
hello
- + , ); await user.click(screen.getByRole("button", { name: "Open" })); expect(screen.getByText("hello")).toBeVisible(); diff --git a/src/components/ProjectSelect/ProjectSelect.test.tsx b/src/components/ProjectSelect/ProjectSelect.test.tsx index 0a85d7388b..43ed0ccc7f 100644 --- a/src/components/ProjectSelect/ProjectSelect.test.tsx +++ b/src/components/ProjectSelect/ProjectSelect.test.tsx @@ -26,7 +26,7 @@ describe("projectSelect", () => { selectedProjectIdentifier="evergreen" getRoute={getCommitsRoute} /> - + , ); const { baseElement } = renderWithRouterMatch(); await waitFor(() => { @@ -42,7 +42,7 @@ describe("projectSelect", () => { selectedProjectIdentifier="evergreen" getRoute={getCommitsRoute} /> - + , ); renderWithRouterMatch(); @@ -57,7 +57,7 @@ describe("projectSelect", () => { expect(options).toHaveLength(6); await user.type( screen.queryByDataCy("project-select-search-input"), - "logkeeper" + "logkeeper", ); options = await screen.findAllByDataCy("project-display-name"); expect(options).toHaveLength(1); @@ -71,7 +71,7 @@ describe("projectSelect", () => { selectedProjectIdentifier="evergreen" getRoute={getCommitsRoute} /> - + , ); renderWithRouterMatch(); @@ -84,7 +84,7 @@ describe("projectSelect", () => { await user.type( screen.queryByDataCy("project-select-search-input"), - "aaa/totally-different-name" + "aaa/totally-different-name", ); const options = await screen.findAllByDataCy("project-display-name"); expect(options).toHaveLength(2); @@ -92,7 +92,7 @@ describe("projectSelect", () => { expect( screen.queryByRole("button", { name: "aaa/totally-different-name", - }) + }), ).toBeNull(); }); }); @@ -106,7 +106,7 @@ describe("projectSelect", () => { getRoute={getProjectSettingsRoute} isProjectSettingsPage /> - + , ); const { baseElement } = renderWithRouterMatch(); await waitFor(() => { @@ -123,7 +123,7 @@ describe("projectSelect", () => { getRoute={getProjectSettingsRoute} isProjectSettingsPage /> - + , ); renderWithRouterMatch(); @@ -138,7 +138,7 @@ describe("projectSelect", () => { expect(options).toHaveLength(5); await user.type( screen.queryByDataCy("project-select-search-input"), - "evergreen" + "evergreen", ); options = await screen.findAllByDataCy("project-display-name"); expect(options).toHaveLength(2); @@ -153,7 +153,7 @@ describe("projectSelect", () => { getRoute={getProjectSettingsRoute} isProjectSettingsPage /> - + , ); renderWithRouterMatch(); @@ -166,7 +166,7 @@ describe("projectSelect", () => { await user.type( screen.queryByDataCy("project-select-search-input"), - "aaa/totally-different-name" + "aaa/totally-different-name", ); const options = await screen.findAllByDataCy("project-display-name"); expect(options).toHaveLength(1); @@ -174,7 +174,7 @@ describe("projectSelect", () => { expect( screen.getByRole("button", { name: "aaa/totally-different-name", - }) + }), ).toBeInTheDocument(); }); @@ -187,7 +187,7 @@ describe("projectSelect", () => { getRoute={getProjectSettingsRoute} isProjectSettingsPage /> - + , ); renderWithRouterMatch(); @@ -210,7 +210,7 @@ describe("projectSelect", () => { getRoute={getProjectSettingsRoute} isProjectSettingsPage /> - + , ); renderWithRouterMatch(); @@ -237,7 +237,7 @@ describe("projectSelect", () => { getRoute={getProjectSettingsRoute} isProjectSettingsPage /> - + , ); renderWithRouterMatch(); @@ -353,7 +353,7 @@ const getProjectsMock: [ApolloMock] = [ ]; const getViewableProjectsMock: [ - ApolloMock + ApolloMock, ] = [ { request: { @@ -434,7 +434,7 @@ const getViewableProjectsMock: [ ]; const noDisabledProjectsMock: [ - ApolloMock + ApolloMock, ] = [ { request: { diff --git a/src/components/ProjectSelect/index.tsx b/src/components/ProjectSelect/index.tsx index b9c7b72ad1..888c37ca90 100644 --- a/src/components/ProjectSelect/index.tsx +++ b/src/components/ProjectSelect/index.tsx @@ -41,7 +41,7 @@ export const ProjectSelect: React.FC = ({ VIEWABLE_PROJECTS, { skip: !isProjectSettingsPage, - } + }, ); const loading = isProjectSettingsPage @@ -51,7 +51,7 @@ export const ProjectSelect: React.FC = ({ const allProjects = getProjects( projectsData, viewableProjectsData, - isProjectSettingsPage + isProjectSettingsPage, ); // Find the project with the selectedProjectIdentifier and set it as the selected project @@ -60,29 +60,32 @@ export const ProjectSelect: React.FC = ({ allProjects .flatMap((g) => g.projects) .find((p) => p.identifier === selectedProjectIdentifier), - [allProjects, selectedProjectIdentifier] + [allProjects, selectedProjectIdentifier], ); const handleSearch = (options: typeof allProjects, value: string) => { // iterate through options and remove any groups that have no matching projects - const filteredProjects = options.reduce((acc, g) => { - const { groupDisplayName, projects: pg, repo } = g; - - const newProjects = pg.filter( - (p) => - groupDisplayName.toLowerCase().includes(value.toLowerCase()) || - p.displayName.toLowerCase().includes(value.toLowerCase()) || - p.identifier.toLowerCase().includes(value.toLowerCase()) - ); - if (newProjects.length > 0) { - acc.push({ - groupDisplayName, - projects: newProjects, - ...(repo && { repo }), - }); - } - return acc; - }, [] as typeof allProjects); + const filteredProjects = options.reduce( + (acc, g) => { + const { groupDisplayName, projects: pg, repo } = g; + + const newProjects = pg.filter( + (p) => + groupDisplayName.toLowerCase().includes(value.toLowerCase()) || + p.displayName.toLowerCase().includes(value.toLowerCase()) || + p.identifier.toLowerCase().includes(value.toLowerCase()), + ); + if (newProjects.length > 0) { + acc.push({ + groupDisplayName, + projects: newProjects, + ...(repo && { repo }), + }); + } + return acc; + }, + [] as typeof allProjects, + ); return filteredProjects; }; @@ -128,14 +131,14 @@ const getFavoriteProjects = (projectGroups: ProjectsQuery["projects"]) => const filterDisabledProjects = ( projects: Unpacked< ViewableProjectRefsQuery["viewableProjectRefs"] - >["projects"] + >["projects"], ) => projects.reduce( ([enabled, disabled], project) => project.enabled === false ? [enabled, [...disabled, project]] : [[...enabled, project], disabled], - [[], []] + [[], []], ); type ViewableProjectRef = Unpacked< @@ -149,13 +152,13 @@ interface GetProjectsResult { type GetProjectsType = ( projectsData: ProjectsQuery, viewableProjectsData: ViewableProjectRefsQuery, - isProjectSettingsPage: boolean + isProjectSettingsPage: boolean, ) => GetProjectsResult[]; const getProjects: GetProjectsType = ( projectsData, viewableProjectsData, - isProjectSettingsPage + isProjectSettingsPage, ) => { if (!isProjectSettingsPage) { const projectGroups = projectsData?.projects ?? []; diff --git a/src/components/Redirects/ProjectSettingsRedirect.tsx b/src/components/Redirects/ProjectSettingsRedirect.tsx index 838207fa85..8ea737779d 100644 --- a/src/components/Redirects/ProjectSettingsRedirect.tsx +++ b/src/components/Redirects/ProjectSettingsRedirect.tsx @@ -26,7 +26,7 @@ export const ProjectSettingsRedirect: React.FC = () => { ); diff --git a/src/components/ScheduleTasksModal/index.tsx b/src/components/ScheduleTasksModal/index.tsx index fe56b889b6..75f15ada03 100644 --- a/src/components/ScheduleTasksModal/index.tsx +++ b/src/components/ScheduleTasksModal/index.tsx @@ -45,11 +45,11 @@ export const ScheduleTasksModal: React.FC = ({ }, onError({ message }) { dispatchToast.error( - `There was an error scheduling tasks: ${message}` + `There was an error scheduling tasks: ${message}`, ); closeModal(); }, - } + }, ); const [ @@ -59,7 +59,7 @@ export const ScheduleTasksModal: React.FC = ({ UNSCHEDULED_TASKS, { variables: { versionId }, - } + }, ); useEffect(() => { if (open && !calledTaskData) { @@ -109,10 +109,10 @@ export const ScheduleTasksModal: React.FC = ({ {sortedBuildVariantGroups.map( ({ buildVariant, buildVariantDisplayName, tasks }) => { const allTasksSelected = tasks.every(({ id }) => - selectedTasks.has(id) + selectedTasks.has(id), ); const someTasksSelected = tasks.some(({ id }) => - selectedTasks.has(id) + selectedTasks.has(id), ); return ( @@ -155,7 +155,7 @@ export const ScheduleTasksModal: React.FC = ({ ); - } + }, )} )} diff --git a/src/components/ScheduleTasksModal/reducer.ts b/src/components/ScheduleTasksModal/reducer.ts index c01e25bdaf..d5bb03e3ef 100644 --- a/src/components/ScheduleTasksModal/reducer.ts +++ b/src/components/ScheduleTasksModal/reducer.ts @@ -42,7 +42,7 @@ export const reducer = (state: State, action: Action): State => { selectedTasks, sortedBuildVariantGroups .find(({ buildVariant }) => action.buildVariant === buildVariant) - ?.tasks.map(({ id }) => id) ?? [] + ?.tasks.map(({ id }) => id) ?? [], ), }; case "toggleSelectAll": @@ -67,7 +67,7 @@ export const initialState: State = { }; const getSortedBuildVariantGroups = ( - data?: UndispatchedTasksQuery + data?: UndispatchedTasksQuery, ): BVGroupEntry[] => { const bvGroups: BVGroupsInterface = data?.version?.tasks?.data.reduce( (acc, task) => { @@ -83,11 +83,11 @@ const getSortedBuildVariantGroups = ( } return acc; }, - {} + {}, ); // sort the build variants const sortedBuildVariants = Object.values(bvGroups ?? {}).sort((a, b) => - a.buildVariantDisplayName.localeCompare(b.buildVariantDisplayName) + a.buildVariantDisplayName.localeCompare(b.buildVariantDisplayName), ); // sort the tasks sortedBuildVariants.forEach(({ tasks }) => { diff --git a/src/components/SearchableDropdown/SearchableDropdown.test.tsx b/src/components/SearchableDropdown/SearchableDropdown.test.tsx index b0dac9c257..6bed4776a0 100644 --- a/src/components/SearchableDropdown/SearchableDropdown.test.tsx +++ b/src/components/SearchableDropdown/SearchableDropdown.test.tsx @@ -2,7 +2,7 @@ import { render, screen, userEvent } from "test_utils"; import SearchableDropdown from "."; const RenderSearchableDropdown = ( - props: Omit, "label"> + props: Omit, "label">, ) => ; describe("searchableDropdown", () => { @@ -12,7 +12,7 @@ describe("searchableDropdown", () => { value: "evergreen", onChange: jest.fn(), options: ["evergreen", "spruce"], - }) + }), ); expect(screen.getByText("evergreen")).toBeInTheDocument(); }); @@ -24,18 +24,18 @@ describe("searchableDropdown", () => { value: "evergreen", onChange: jest.fn(), options: ["evergreen", "spruce"], - }) + }), ); expect( - screen.queryByDataCy("searchable-dropdown-options") + screen.queryByDataCy("searchable-dropdown-options"), ).not.toBeInTheDocument(); await user.click(screen.queryByDataCy("searchable-dropdown")); expect( - screen.getByDataCy("searchable-dropdown-options") + screen.getByDataCy("searchable-dropdown-options"), ).toBeInTheDocument(); await user.click(screen.queryByDataCy("searchable-dropdown")); expect( - screen.queryByDataCy("searchable-dropdown-options") + screen.queryByDataCy("searchable-dropdown-options"), ).not.toBeInTheDocument(); }); @@ -46,27 +46,27 @@ describe("searchableDropdown", () => { value: "evergreen", onChange: jest.fn(), options: ["evergreen", "spruce"], - }) + }), ); expect( - screen.queryByDataCy("searchable-dropdown-options") + screen.queryByDataCy("searchable-dropdown-options"), ).not.toBeInTheDocument(); await user.click(screen.queryByDataCy("searchable-dropdown")); expect( - screen.getByDataCy("searchable-dropdown-options") + screen.getByDataCy("searchable-dropdown-options"), ).toBeInTheDocument(); expect( - screen.getByDataCy("searchable-dropdown-search-input") + screen.getByDataCy("searchable-dropdown-search-input"), ).toBeInTheDocument(); expect(screen.queryAllByDataCy("searchable-dropdown-option")).toHaveLength( - 2 + 2, ); await user.type( screen.queryByDataCy("searchable-dropdown-search-input"), - "spru" + "spru", ); expect(screen.queryAllByDataCy("searchable-dropdown-option")).toHaveLength( - 1 + 1, ); }); @@ -77,36 +77,36 @@ describe("searchableDropdown", () => { value: "evergreen", onChange: jest.fn(), options: ["evergreen", "spruce"], - }) + }), ); // use text input to filter and click on document body (which closes the dropdown). await user.click(screen.queryByDataCy("searchable-dropdown")); expect(screen.queryAllByDataCy("searchable-dropdown-option")).toHaveLength( - 2 + 2, ); await user.type( screen.queryByDataCy("searchable-dropdown-search-input"), - "spru" + "spru", ); expect(screen.queryAllByDataCy("searchable-dropdown-option")).toHaveLength( - 1 + 1, ); await user.click(screen.queryByText("spruce")); // when reopening the dropdown, the text input should be cleared and all options should be visible. await user.click(screen.queryByDataCy("searchable-dropdown")); expect(screen.queryAllByDataCy("searchable-dropdown-option")).toHaveLength( - 2 + 2, ); expect( - screen.queryByDataCy("searchable-dropdown-search-input") + screen.queryByDataCy("searchable-dropdown-search-input"), ).toHaveValue(""); }); it("should use custom search function when passed in", async () => { const user = userEvent.setup(); const searchFunc = jest.fn((options, match) => - options.filter((o) => o === match) + options.filter((o) => o === match), ); render( RenderSearchableDropdown({ @@ -114,20 +114,20 @@ describe("searchableDropdown", () => { onChange: jest.fn(), options: ["evergreen", "spruce"], searchFunc, - }) + }), ); await user.click(screen.queryByDataCy("searchable-dropdown")); expect( - screen.getByDataCy("searchable-dropdown-search-input") + screen.getByDataCy("searchable-dropdown-search-input"), ).toBeInTheDocument(); await user.type( screen.queryByDataCy("searchable-dropdown-search-input"), - "spruce" + "spruce", ); expect(searchFunc).toHaveBeenLastCalledWith( ["evergreen", "spruce"], - "spruce" + "spruce", ); expect(screen.getByText("spruce")).toBeInTheDocument(); }); @@ -141,19 +141,19 @@ describe("searchableDropdown", () => { value: "evergreen", onChange, options: ["evergreen", "spruce"], - }) + }), ); expect( - screen.queryByDataCy("searchable-dropdown-options") + screen.queryByDataCy("searchable-dropdown-options"), ).not.toBeInTheDocument(); await user.click(screen.queryByDataCy("searchable-dropdown")); expect( - screen.getByDataCy("searchable-dropdown-options") + screen.getByDataCy("searchable-dropdown-options"), ).toBeInTheDocument(); await user.click(screen.queryByText("spruce")); expect(onChange).toHaveBeenCalledWith("spruce"); expect( - screen.queryByDataCy("searchable-dropdown-options") + screen.queryByDataCy("searchable-dropdown-options"), ).not.toBeInTheDocument(); rerender( @@ -161,7 +161,7 @@ describe("searchableDropdown", () => { value: "spruce", onChange, options: ["evergreen", "spruce"], - }) + }), ); expect(screen.getByText("spruce")).toBeInTheDocument(); }); @@ -173,29 +173,29 @@ describe("searchableDropdown", () => { value: "evergreen", onChange: jest.fn(), options: ["evergreen", "spruce"], - }) + }), ); // use text input to filter and select an option. await user.click(screen.queryByDataCy("searchable-dropdown")); expect( - screen.queryAllByDataCy("searchable-dropdown-option") + screen.queryAllByDataCy("searchable-dropdown-option"), ).toHaveLength(2); await user.type( screen.queryByDataCy("searchable-dropdown-search-input"), - "spru" + "spru", ); expect( - screen.queryAllByDataCy("searchable-dropdown-option") + screen.queryAllByDataCy("searchable-dropdown-option"), ).toHaveLength(1); await user.click(screen.queryByText("spruce")); // when reopening the dropdown, the text input should be cleared and all options should be visible. await user.click(screen.queryByDataCy("searchable-dropdown")); expect( - screen.queryAllByDataCy("searchable-dropdown-option") + screen.queryAllByDataCy("searchable-dropdown-option"), ).toHaveLength(2); expect( - screen.queryByDataCy("searchable-dropdown-search-input") + screen.queryByDataCy("searchable-dropdown-search-input"), ).toHaveValue(""); }); @@ -206,11 +206,11 @@ describe("searchableDropdown", () => { value: "evergreen", onChange: jest.fn(), options: ["evergreen", "spruce"], - }) + }), ); await user.click(screen.queryByDataCy("searchable-dropdown")); expect( - screen.queryAllByDataCy("searchable-dropdown-option") + screen.queryAllByDataCy("searchable-dropdown-option"), ).toHaveLength(2); expect(screen.queryByDataCy("checkmark")).toBeNull(); }); @@ -226,14 +226,14 @@ describe("searchableDropdown", () => { onChange, options: ["evergreen", "spruce"], allowMultiSelect: true, - }) + }), ); expect( - screen.queryByDataCy("searchable-dropdown-options") + screen.queryByDataCy("searchable-dropdown-options"), ).not.toBeInTheDocument(); await user.click(screen.queryByDataCy("searchable-dropdown")); expect( - screen.getByDataCy("searchable-dropdown-options") + screen.getByDataCy("searchable-dropdown-options"), ).toBeInTheDocument(); await user.click(screen.queryByText("spruce")); expect(onChange).toHaveBeenCalledWith(["spruce"]); @@ -244,10 +244,10 @@ describe("searchableDropdown", () => { onChange, options: ["evergreen", "spruce"], allowMultiSelect: true, - }) + }), ); expect( - screen.getByDataCy("searchable-dropdown-options") + screen.getByDataCy("searchable-dropdown-options"), ).toBeInTheDocument(); rerender( @@ -256,7 +256,7 @@ describe("searchableDropdown", () => { onChange, options: ["evergreen", "spruce"], allowMultiSelect: true, - }) + }), ); await user.click(screen.queryByText("evergreen")); expect(onChange).toHaveBeenCalledWith(["spruce", "evergreen"]); @@ -270,28 +270,28 @@ describe("searchableDropdown", () => { onChange: jest.fn(), options: ["evergreen", "spruce", "sandbox"], allowMultiSelect: true, - }) + }), ); // use text input to filter and select an option. await user.click(screen.queryByDataCy("searchable-dropdown")); expect( - screen.queryAllByDataCy("searchable-dropdown-option") + screen.queryAllByDataCy("searchable-dropdown-option"), ).toHaveLength(3); await user.type( screen.queryByDataCy("searchable-dropdown-search-input"), - "s" + "s", ); expect( - screen.queryAllByDataCy("searchable-dropdown-option") + screen.queryAllByDataCy("searchable-dropdown-option"), ).toHaveLength(2); await user.click(screen.queryByText("spruce")); // the dropdown should not be closed and the search state should not be reset. expect( - screen.queryByDataCy("searchable-dropdown-search-input") + screen.queryByDataCy("searchable-dropdown-search-input"), ).toHaveValue("s"); expect( - screen.queryAllByDataCy("searchable-dropdown-option") + screen.queryAllByDataCy("searchable-dropdown-option"), ).toHaveLength(2); }); @@ -303,11 +303,11 @@ describe("searchableDropdown", () => { onChange: jest.fn(), options: ["evergreen", "spruce"], allowMultiSelect: true, - }) + }), ); await user.click(screen.queryByDataCy("searchable-dropdown")); expect( - screen.queryAllByDataCy("searchable-dropdown-option") + screen.queryAllByDataCy("searchable-dropdown-option"), ).toHaveLength(2); expect(screen.queryAllByDataCy("checkmark")).toHaveLength(2); }); @@ -339,7 +339,7 @@ describe("searchableDropdown", () => { {option.label} ), - }) + }), ); await user.click(screen.queryByDataCy("searchable-dropdown")); expect(screen.getByText("Evergreen")).toBeInTheDocument(); @@ -374,7 +374,7 @@ describe("searchableDropdown", () => { {option.label} ), - }) + }), ); await user.click(screen.queryByDataCy("searchable-dropdown")); @@ -392,12 +392,12 @@ describe("searchableDropdown", () => { buttonRenderer: (option: string) => ( {option} ), - }) + }), ); expect(screen.getByText("evergreen")).toBeInTheDocument(); expect(screen.queryByText("evergreen")).toHaveAttribute( "class", - "just-a-test" + "just-a-test", ); }); }); diff --git a/src/components/SearchableDropdown/index.tsx b/src/components/SearchableDropdown/index.tsx index aafaa42b5d..ce9724cd1a 100644 --- a/src/components/SearchableDropdown/index.tsx +++ b/src/components/SearchableDropdown/index.tsx @@ -28,7 +28,7 @@ export interface SearchableDropdownProps { optionRenderer?: ( option: T, onClick: (selectedV) => void, - isChecked: (selectedV) => boolean + isChecked: (selectedV) => boolean, ) => React.ReactNode; searchFunc?: (options: T[], match: string) => T[]; searchPlaceholder?: string; @@ -119,18 +119,18 @@ const SearchableDropdown = ({ filteredOptions = searchFunc(options as T[], searchTerm); } else if (typeof options[0] === "string") { filteredOptions = (options as string[]).filter( - (o) => o.toLowerCase().indexOf(searchTerm.toLowerCase()) !== -1 + (o) => o.toLowerCase().indexOf(searchTerm.toLowerCase()) !== -1, ); } else { console.error( - "A searchFunc must be supplied when options is not of type string[]" + "A searchFunc must be supplied when options is not of type string[]", ); } } setVisibleOptions(filteredOptions); }, - [searchFunc, options] + [searchFunc, options], ); let buttonText = valuePlaceholder; diff --git a/src/components/SetPriority/SetPriority.test.tsx b/src/components/SetPriority/SetPriority.test.tsx index c82b815a40..d4f5945a67 100644 --- a/src/components/SetPriority/SetPriority.test.tsx +++ b/src/components/SetPriority/SetPriority.test.tsx @@ -18,13 +18,13 @@ describe("setPriority", () => { const { Component } = RenderFakeToastContext( - + , ); renderWithRouterMatch(); await user.click(screen.queryByDataCy("prioritize-patch")); expect( - screen.queryByDataCy("set-patch-priority-popconfirm") + screen.queryByDataCy("set-patch-priority-popconfirm"), ).toBeVisible(); expect(screen.queryByDataCy("priority-default-message")).toBeVisible(); await user.type(screen.queryByDataCy("patch-priority-input"), "9"); @@ -36,13 +36,13 @@ describe("setPriority", () => { const { Component } = RenderFakeToastContext( - + , ); renderWithRouterMatch(); await user.click(screen.queryByDataCy("prioritize-patch")); expect( - screen.queryByDataCy("set-patch-priority-popconfirm") + screen.queryByDataCy("set-patch-priority-popconfirm"), ).toBeVisible(); expect(screen.queryByDataCy("priority-warning-message")).toBeNull(); await user.type(screen.queryByDataCy("patch-priority-input"), "99"); @@ -54,13 +54,13 @@ describe("setPriority", () => { const { Component } = RenderFakeToastContext( - + , ); renderWithRouterMatch(); await user.click(screen.queryByDataCy("prioritize-patch")); expect( - screen.queryByDataCy("set-patch-priority-popconfirm") + screen.queryByDataCy("set-patch-priority-popconfirm"), ).toBeVisible(); expect(screen.queryByDataCy("priority-admin-message")).toBeNull(); await user.type(screen.queryByDataCy("patch-priority-input"), "999"); @@ -72,13 +72,13 @@ describe("setPriority", () => { const { Component, dispatchToast } = RenderFakeToastContext( - + , ); renderWithRouterMatch(); await user.click(screen.queryByDataCy("prioritize-patch")); expect( - screen.queryByDataCy("set-patch-priority-popconfirm") + screen.queryByDataCy("set-patch-priority-popconfirm"), ).toBeVisible(); await user.type(screen.queryByDataCy("patch-priority-input"), "99"); await user.click(screen.getByRole("button", { name: "Set" })); @@ -92,13 +92,13 @@ describe("setPriority", () => { const { Component } = RenderFakeToastContext( - + , ); renderWithRouterMatch(); await user.click(screen.queryByDataCy("prioritize-task")); expect( - screen.queryByDataCy("set-task-priority-popconfirm") + screen.queryByDataCy("set-task-priority-popconfirm"), ).toBeVisible(); expect(screen.queryByDataCy("task-priority-input")).toHaveValue(10); }); @@ -108,14 +108,14 @@ describe("setPriority", () => { const { Component } = RenderFakeToastContext( - + , ); renderWithRouterMatch(); await user.click(screen.queryByDataCy("prioritize-task")); await waitFor(() => { expect( - screen.queryByDataCy("set-task-priority-popconfirm") + screen.queryByDataCy("set-task-priority-popconfirm"), ).toBeVisible(); }); expect(screen.queryByDataCy("priority-default-message")).toBeVisible(); @@ -128,14 +128,14 @@ describe("setPriority", () => { const { Component } = RenderFakeToastContext( - + , ); renderWithRouterMatch(); await user.click(screen.queryByDataCy("prioritize-task")); await waitFor(() => { expect( - screen.queryByDataCy("set-task-priority-popconfirm") + screen.queryByDataCy("set-task-priority-popconfirm"), ).toBeVisible(); }); expect(screen.queryByDataCy("priority-warning-message")).toBeNull(); @@ -148,14 +148,14 @@ describe("setPriority", () => { const { Component } = RenderFakeToastContext( - + , ); renderWithRouterMatch(); await user.click(screen.queryByDataCy("prioritize-task")); await waitFor(() => { expect( - screen.queryByDataCy("set-task-priority-popconfirm") + screen.queryByDataCy("set-task-priority-popconfirm"), ).toBeVisible(); }); expect(screen.queryByDataCy("priority-admin-message")).toBeNull(); @@ -168,20 +168,20 @@ describe("setPriority", () => { const { Component, dispatchToast } = RenderFakeToastContext( - + , ); renderWithRouterMatch(); await user.click(screen.queryByDataCy("prioritize-task")); await waitFor(() => { expect( - screen.queryByDataCy("set-task-priority-popconfirm") + screen.queryByDataCy("set-task-priority-popconfirm"), ).toBeVisible(); }); await user.type(screen.queryByDataCy("task-priority-input"), "99"); await user.click(screen.getByRole("button", { name: "Set" })); await waitFor(() => - expect(dispatchToast.success).toHaveBeenCalledTimes(1) + expect(dispatchToast.success).toHaveBeenCalledTimes(1), ); }); }); diff --git a/src/components/SetPriority/index.tsx b/src/components/SetPriority/index.tsx index 55762a8042..861e19f4a7 100644 --- a/src/components/SetPriority/index.tsx +++ b/src/components/SetPriority/index.tsx @@ -68,7 +68,7 @@ const SetPriority: React.FC = ({ dispatchToast.success( data.setTaskPriority.priority >= 0 ? `Priority for task updated to ${data.setTaskPriority.priority}` - : `Task was successfully disabled` + : `Task was successfully disabled`, ); }, onError: (err) => { diff --git a/src/components/Settings/Context.test.tsx b/src/components/Settings/Context.test.tsx index 6e256d121c..1102de12b4 100644 --- a/src/components/Settings/Context.test.tsx +++ b/src/components/Settings/Context.test.tsx @@ -127,7 +127,7 @@ describe("useHasUnsavedTab", () => { }), { wrapper: TestProvider, - } + }, ); expect(result.current.unsavedTabs).toStrictEqual([]); expect(result.current.hasUnsaved).toBe(false); @@ -156,7 +156,7 @@ describe("usePopulateForm", () => { }), { wrapper: TestProvider, - } + }, ); expect(result.current.hasUnsaved).toBe(false); expect(result.current.getTab("foo")).toStrictEqual({ diff --git a/src/components/Settings/Context.tsx b/src/components/Settings/Context.tsx index 2e1e723286..856675f043 100644 --- a/src/components/Settings/Context.tsx +++ b/src/components/Settings/Context.tsx @@ -14,7 +14,7 @@ import { FormToGqlFunction, SettingsRoutes } from "./types"; type OnChangeParams< T extends SettingsRoutes, - FormStateMap extends Record + FormStateMap extends Record, > = Pick< Parameters["onChange"]>[0], "formData" | "errors" @@ -25,7 +25,7 @@ type OnChangeParams< // For now, leave as-is and assert form state types when errors are thrown. export type TabState< T extends SettingsRoutes, - FormStateMap extends Record + FormStateMap extends Record, > = { [K in T]: { hasChanges: boolean; @@ -55,11 +55,11 @@ type Action> = const reducer = >( - getTransformer: Record> + getTransformer: Record>, ) => ( state: TabState, - action: Action + action: Action, ): TabState => { switch (action.type) { case "saveTab": @@ -90,7 +90,7 @@ const reducer = ...state[action.tab], hasChanges: !isEqual( state[action.tab].initialData, - formToGql(action.formData) + formToGql(action.formData), ), }, }; @@ -104,7 +104,7 @@ const reducer = initialData: getTransformer[tab](data), }, }), - state + state, ); default: throw new Error("Unknown action type"); @@ -113,28 +113,28 @@ const reducer = interface SettingsState< T extends SettingsRoutes, - FormStateMap extends Record + FormStateMap extends Record, > { tabs: TabState; saveTab: (tab: T) => void; getTab: (tab: T) => TabState[T]; updateForm: (tab: T) => (e: OnChangeParams) => void; setInitialData: ( - tabData: Record[T]["formData"]> + tabData: Record[T]["formData"]>, ) => void; } const createSettingsContext = < T extends SettingsRoutes, - FormStateMap extends Record + FormStateMap extends Record, >() => createContext | null>(null); const useSettingsState = < T extends SettingsRoutes, - FormStateMap extends Record + FormStateMap extends Record, >( routes: T[], - getTransformer: Record any> + getTransformer: Record any>, ): SettingsState => { const [state, dispatch] = useReducer( reducer(getTransformer), @@ -143,7 +143,7 @@ const useSettingsState = < hasError: false, initialData: null, formData: null, - }) + }), ); const setHasChanges = useMemo( @@ -151,7 +151,7 @@ const useSettingsState = < debounce((tab, formData) => { dispatch({ type: "setHasChanges", tab, formData }); }, 400), - [] + [], ); const updateForm = ((tab) => @@ -184,9 +184,9 @@ const useSettingsState = < const getUsePopulateForm = < T extends SettingsRoutes, - FormStateMap extends Record + FormStateMap extends Record, >( - context: Context> + context: Context>, ) => function usePopulateForm(formData: FormStateMap[T], tab: T): void { const { getTab, saveTab, updateForm } = useContext(context); @@ -204,9 +204,9 @@ const getUsePopulateForm = < const getUseHasUnsavedTab = < T extends SettingsRoutes, - FormStateMap extends Record + FormStateMap extends Record, >( - context: Context> + context: Context>, ) => function useHasUnsavedTab(): { hasUnsaved: boolean; @@ -218,10 +218,10 @@ const getUseHasUnsavedTab = < Object.entries(tabs) .filter( ([, tabData]) => - (tabData as TabState[T]).hasChanges + (tabData as TabState[T]).hasChanges, ) .map(([tab]) => tab as T), - [tabs] + [tabs], ); return { @@ -232,16 +232,16 @@ const getUseHasUnsavedTab = < const getDefaultTabState = < T extends SettingsRoutes, - FormStateMap extends Record + FormStateMap extends Record, >( routes: T[], - defaultValue: TabState[T] + defaultValue: TabState[T], ): TabState => Object.assign( {}, ...routes.map((route) => ({ [route]: defaultValue, - })) + })), ); export { diff --git a/src/components/Settings/EventLog/eventLogDiffs.ts b/src/components/Settings/EventLog/eventLogDiffs.ts index eea711972c..b8bd28af42 100644 --- a/src/components/Settings/EventLog/eventLogDiffs.ts +++ b/src/components/Settings/EventLog/eventLogDiffs.ts @@ -28,7 +28,7 @@ const getNestedObject = (nestedObj: object, pathArr: string[]): EventValue => export const getEventDiffLines = ( before: Event["before"], - after: Event["after"] + after: Event["after"], ): EventDiffLine[] => { const beforeNoTypename = omitTypename(before); const afterNoTypename = omitTypename(after); diff --git a/src/components/Settings/Form.tsx b/src/components/Settings/Form.tsx index 7d4e196951..295c071781 100644 --- a/src/components/Settings/Form.tsx +++ b/src/components/Settings/Form.tsx @@ -8,7 +8,7 @@ import { SettingsRoutes } from "./types"; export type FormProps< T extends SettingsRoutes, - FormStateMap extends Record + FormStateMap extends Record, > = { disabled?: boolean; formSchema: ReturnType; @@ -19,7 +19,7 @@ export type FormProps< export const Form = < T extends SettingsRoutes, - FormStateMap extends Record + FormStateMap extends Record, >({ disabled, formSchema, diff --git a/src/components/Settings/NavigationWarningModal.test.tsx b/src/components/Settings/NavigationWarningModal.test.tsx index 2eb756f178..a44385c6da 100644 --- a/src/components/Settings/NavigationWarningModal.test.tsx +++ b/src/components/Settings/NavigationWarningModal.test.tsx @@ -40,7 +40,7 @@ const getRouter = ({ shouldBlock, unsavedTabs }: NavigationModalProps) => ], { initialEntries: ["/"], - } + }, ); describe("navigation warning", () => { @@ -54,7 +54,7 @@ describe("navigation warning", () => { await user.click(screen.getByRole("link")); expect(router.state.location.pathname).toBe("/about"); expect( - screen.queryByDataCy("navigation-warning-modal") + screen.queryByDataCy("navigation-warning-modal"), ).not.toBeInTheDocument(); expect(screen.queryByRole("heading")).toHaveTextContent("About Page"); }); diff --git a/src/components/Settings/test-utils.tsx b/src/components/Settings/test-utils.tsx index af812fd8d9..c51b972ddb 100644 --- a/src/components/Settings/test-utils.tsx +++ b/src/components/Settings/test-utils.tsx @@ -43,7 +43,7 @@ const TestProvider = ({ children }) => { tabs, updateForm, }), - [getTab, saveTab, setInitialData, tabs, updateForm] + [getTab, saveTab, setInitialData, tabs, updateForm], ); return ( @@ -55,7 +55,7 @@ const useTestContext = (): SettingsState => { const context = useContext(TestContext); if (context === undefined) { throw new Error( - "useProjectSettingsContext must be used within a ProjectSettingsProvider" + "useProjectSettingsContext must be used within a ProjectSettingsProvider", ); } return context; diff --git a/src/components/Settings/types.ts b/src/components/Settings/types.ts index 65013ecfcd..2fbeaf0c3c 100644 --- a/src/components/Settings/types.ts +++ b/src/components/Settings/types.ts @@ -1,5 +1,5 @@ export type SettingsRoutes = string; export type FormToGqlFunction = ( form: Record, - id?: string + id?: string, ) => any; diff --git a/src/components/Spawn/MountVolumeSelect.tsx b/src/components/Spawn/MountVolumeSelect.tsx index cea519833c..ace7358340 100644 --- a/src/components/Spawn/MountVolumeSelect.tsx +++ b/src/components/Spawn/MountVolumeSelect.tsx @@ -53,7 +53,7 @@ export const MountVolumeSelect = ({ const opts = data.myHosts // Filter hosts that do not have the same availability zone as the volume. .filter(({ availabilityZone, status }) => - canUpdateHost(status, availabilityZone) + canUpdateHost(status, availabilityZone), ) // Map host to a displayName and ID for the dropdown