Skip to content

Commit

Permalink
sort imports with eslint
Browse files Browse the repository at this point in the history
  • Loading branch information
bnussman committed Dec 4, 2024
1 parent ad2d6be commit 600512d
Show file tree
Hide file tree
Showing 140 changed files with 696 additions and 564 deletions.
81 changes: 41 additions & 40 deletions packages/manager/cypress.config.ts
Original file line number Diff line number Diff line change
@@ -1,85 +1,63 @@
/* eslint-disable no-console */
import { defineConfig } from 'cypress';

import { setupPlugins } from './cypress/support/plugins';
import { configureApi } from './cypress/support/plugins/configure-api';
import { configureBrowser } from './cypress/support/plugins/configure-browser';
import { configureFileWatching } from './cypress/support/plugins/configure-file-watching';
import { configureTestSuite } from './cypress/support/plugins/configure-test-suite';
import { discardPassedTestRecordings } from './cypress/support/plugins/discard-passed-test-recordings';
import { featureFlagOverrides } from './cypress/support/plugins/feature-flag-override';
import { fetchAccount } from './cypress/support/plugins/fetch-account';
import { fetchLinodeRegions } from './cypress/support/plugins/fetch-linode-regions';
import { generateTestWeights } from './cypress/support/plugins/generate-weights';
import { enableJunitReport } from './cypress/support/plugins/junit-report';
import { loadEnvironmentConfig } from './cypress/support/plugins/load-env-config';
import { nodeVersionCheck } from './cypress/support/plugins/node-version-check';
import { postRunCleanup } from './cypress/support/plugins/post-run-cleanup';
import { regionOverrideCheck } from './cypress/support/plugins/region-override-check';
import { vitePreprocess } from './cypress/support/plugins/vite-preprocessor';
import { configureApi } from './cypress/support/plugins/configure-api';
import { fetchAccount } from './cypress/support/plugins/fetch-account';
import { fetchLinodeRegions } from './cypress/support/plugins/fetch-linode-regions';
import { splitCypressRun } from './cypress/support/plugins/split-run';
import { enableJunitReport } from './cypress/support/plugins/junit-report';
import { generateTestWeights } from './cypress/support/plugins/generate-weights';
import { logTestTagInfo } from './cypress/support/plugins/test-tagging-info';
import { vitePreprocess } from './cypress/support/plugins/vite-preprocessor';
import cypressViteConfig from './cypress/vite.config';
import { featureFlagOverrides } from './cypress/support/plugins/feature-flag-override';
import { postRunCleanup } from './cypress/support/plugins/post-run-cleanup';

/**
* Exports a Cypress configuration object.
*
* {@link https://docs.cypress.io/guides/references/configuration#Options | Cypress configuration documentation}
*/
export default defineConfig({
trashAssetsBeforeRuns: false,

// Browser configuration.
chromeWebSecurity: false,
viewportWidth: 1440,
viewportHeight: 900,

// Timeouts.
requestTimeout: 30000,
responseTimeout: 80000,
defaultCommandTimeout: 80000,
pageLoadTimeout: 60000,

// Recording and test troubleshooting.
projectId: '5rhsif',
screenshotOnRunFailure: true,
video: true,

// Only retry test when running via CI.
retries: process.env['CI'] && !process.env['CY_TEST_DISABLE_RETRIES'] ? 2 : 0,

experimentalMemoryManagement: true,

component: {
devServer: {
framework: 'react',
bundler: 'vite',
framework: 'react',
viteConfig: cypressViteConfig,
},
indexHtmlFile: './cypress/support/component/index.html',
supportFile: './cypress/support/component/setup.tsx',
specPattern: './cypress/component/**/*.spec.tsx',
viewportWidth: 500,
viewportHeight: 500,

setupNodeEvents(on, config) {
return setupPlugins(on, config, [
loadEnvironmentConfig,
discardPassedTestRecordings,
enableJunitReport('Component', true),
]);
},
},
specPattern: './cypress/component/**/*.spec.tsx',
supportFile: './cypress/support/component/setup.tsx',
viewportHeight: 500,

viewportWidth: 500,
},
defaultCommandTimeout: 80000,
e2e: {
experimentalRunAllSpecs: true,

// This can be overridden using `CYPRESS_BASE_URL`.
baseUrl: 'http://localhost:3000',

// This is overridden when `CY_TEST_SUITE` is defined.
// See `cypress/support/plugins/configure-test-suite.ts`.
specPattern: 'cypress/e2e/core/**/*.spec.{ts,tsx}',
experimentalRunAllSpecs: true,

// This is overridden when `CY_TEST_SUITE` is defined.
setupNodeEvents(on, config) {
return setupPlugins(on, config, [
loadEnvironmentConfig,
Expand All @@ -101,5 +79,28 @@ export default defineConfig({
postRunCleanup,
]);
},

// See `cypress/support/plugins/configure-test-suite.ts`.
specPattern: 'cypress/e2e/core/**/*.spec.{ts,tsx}',
},

experimentalMemoryManagement: true,
pageLoadTimeout: 60000,
// Recording and test troubleshooting.
projectId: '5rhsif',
// Timeouts.
requestTimeout: 30000,

responseTimeout: 80000,
// Only retry test when running via CI.
retries: process.env['CI'] && !process.env['CY_TEST_DISABLE_RETRIES'] ? 2 : 0,
screenshotOnRunFailure: true,

trashAssetsBeforeRuns: false,

video: true,

viewportHeight: 900,

viewportWidth: 1440,
});
5 changes: 3 additions & 2 deletions packages/manager/cypress/component/poc/beta-chip.spec.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import * as React from 'react';
import { BetaChip } from 'src/components/BetaChip/BetaChip';
import { componentTests, visualTests } from 'support/util/components';
import { checkComponentA11y } from 'support/util/accessibility';
import { componentTests, visualTests } from 'support/util/components';

import { BetaChip } from 'src/components/BetaChip/BetaChip';

componentTests('BetaChip', () => {
visualTests((mount) => {
Expand Down
79 changes: 40 additions & 39 deletions packages/manager/cypress/component/poc/region-select.spec.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import * as React from 'react';
import { RegionSelect } from 'src/components/RegionSelect/RegionSelect';
import { componentTests, visualTests } from 'support/util/components';
import { checkComponentA11y } from 'support/util/accessibility';
import { accountAvailabilityFactory, regionFactory } from 'src/factories';
import { ui } from 'support/ui';
import { mockGetAccountAvailability } from 'support/intercepts/account';
import { ui } from 'support/ui';
import { checkComponentA11y } from 'support/util/accessibility';
import { createSpy } from 'support/util/components';
import { componentTests, visualTests } from 'support/util/components';

import { RegionSelect } from 'src/components/RegionSelect/RegionSelect';
import { accountAvailabilityFactory, regionFactory } from 'src/factories';

componentTests('RegionSelect', (mount) => {
beforeEach(() => {
Expand All @@ -24,10 +25,10 @@ componentTests('RegionSelect', (mount) => {

mount(
<RegionSelect
regions={[region]}
currentCapability="Object Storage"
value={undefined}
onChange={() => {}}
regions={[region]}
value={undefined}
/>
);

Expand All @@ -52,10 +53,10 @@ componentTests('RegionSelect', (mount) => {

mount(
<RegionSelect
regions={[region]}
currentCapability="Object Storage"
value={undefined}
onChange={() => {}}
regions={[region]}
value={undefined}
/>
);

Expand All @@ -81,10 +82,10 @@ componentTests('RegionSelect', (mount) => {

mount(
<RegionSelect
regions={[region]}
currentCapability="Object Storage"
value={undefined}
onChange={() => {}}
regions={[region]}
value={undefined}
/>
);

Expand All @@ -110,10 +111,10 @@ componentTests('RegionSelect', (mount) => {
<>
<span id="other-element">Other Element</span>
<RegionSelect
regions={[region]}
currentCapability="Object Storage"
value={undefined}
onChange={() => {}}
regions={[region]}
value={undefined}
/>
</>
);
Expand Down Expand Up @@ -143,10 +144,10 @@ componentTests('RegionSelect', (mount) => {
it('can select a region initially', () => {
mount(
<RegionSelect
regions={regions}
currentCapability={undefined}
value={undefined}
onChange={() => {}}
regions={regions}
value={undefined}
/>
);

Expand Down Expand Up @@ -177,10 +178,10 @@ componentTests('RegionSelect', (mount) => {
it('can change region selection', () => {
mount(
<RegionSelect
regions={regions}
currentCapability={undefined}
value={regionToPreselect.id}
onChange={() => {}}
regions={regions}
value={regionToPreselect.id}
/>
);

Expand Down Expand Up @@ -212,10 +213,10 @@ componentTests('RegionSelect', (mount) => {
it('can clear region selection', () => {
mount(
<RegionSelect
regions={regions}
currentCapability={undefined}
value={regionToSelect.id}
onChange={() => {}}
regions={regions}
value={regionToSelect.id}
/>
);

Expand All @@ -238,11 +239,11 @@ componentTests('RegionSelect', (mount) => {
it('cannot clear region selection when clearable is disabled', () => {
mount(
<RegionSelect
regions={regions}
currentCapability={undefined}
value={regionToSelect.id}
disableClearable={true}
onChange={() => {}}
regions={regions}
value={regionToSelect.id}
/>
);

Expand All @@ -258,10 +259,10 @@ componentTests('RegionSelect', (mount) => {
it('cannot clear region selection when no region is selected', () => {
mount(
<RegionSelect
regions={regions}
currentCapability={undefined}
value={undefined}
onChange={() => {}}
regions={regions}
value={undefined}
/>
);

Expand All @@ -275,10 +276,10 @@ componentTests('RegionSelect', (mount) => {
const spyFn = createSpy(() => {}, 'changeSpy');
mount(
<RegionSelect
regions={regions}
currentCapability={undefined}
value={undefined}
onChange={spyFn}
regions={regions}
value={undefined}
/>
);

Expand All @@ -299,10 +300,10 @@ componentTests('RegionSelect', (mount) => {
const spyFn = createSpy(() => {}, 'changeSpy');
mount(
<RegionSelect
regions={regions}
currentCapability={undefined}
value={regionToSelect.id}
onChange={spyFn}
regions={regions}
value={regionToSelect.id}
/>
);

Expand Down Expand Up @@ -343,10 +344,10 @@ componentTests('RegionSelect', (mount) => {
// TODO Remove `dcGetWell` flag override when feature flag is removed from codebase.
mount(
<RegionSelect
regions={regions}
currentCapability="Object Storage"
value={undefined}
onChange={() => {}}
regions={regions}
value={undefined}
/>,
{
dcGetWell: true,
Expand Down Expand Up @@ -377,10 +378,10 @@ componentTests('RegionSelect', (mount) => {
it('only lists regions with the specified capability', () => {
mount(
<RegionSelect
regions={regions}
currentCapability="Object Storage"
value={undefined}
onChange={() => {}}
regions={regions}
value={undefined}
/>
);

Expand All @@ -406,10 +407,10 @@ componentTests('RegionSelect', (mount) => {
it('lists all regions when no capability is specified', () => {
mount(
<RegionSelect
regions={regions}
currentCapability={undefined}
value={undefined}
onChange={() => {}}
regions={regions}
value={undefined}
/>
);

Expand All @@ -436,10 +437,10 @@ componentTests('RegionSelect', (mount) => {
it('passes aXe check when menu is closed without an item selected', () => {
mount(
<RegionSelect
regions={regions}
currentCapability={undefined}
value={undefined}
onChange={() => {}}
regions={regions}
value={undefined}
/>
);
checkComponentA11y();
Expand All @@ -448,10 +449,10 @@ componentTests('RegionSelect', (mount) => {
it('passes aXe check when menu is closed with an item selected', () => {
mount(
<RegionSelect
regions={regions}
currentCapability={undefined}
value={selectedRegion.id}
onChange={() => {}}
regions={regions}
value={selectedRegion.id}
/>
);
checkComponentA11y();
Expand All @@ -460,10 +461,10 @@ componentTests('RegionSelect', (mount) => {
it('passes aXe check when menu is open', () => {
mount(
<RegionSelect
regions={regions}
currentCapability={undefined}
value={selectedRegion.id}
onChange={() => {}}
regions={regions}
value={selectedRegion.id}
/>
);

Expand Down
Loading

0 comments on commit 600512d

Please sign in to comment.