diff --git a/packages/manager/.changeset/pr-12936-tests-1759312166894.md b/packages/manager/.changeset/pr-12936-tests-1759312166894.md new file mode 100644 index 00000000000..f49e7789f8a --- /dev/null +++ b/packages/manager/.changeset/pr-12936-tests-1759312166894.md @@ -0,0 +1,5 @@ +--- +"@linode/manager": Tests +--- + +Add Logs Destination Landing, Create and Edit e2e tests ([#12936](https://github.com/linode/manager/pull/12936)) diff --git a/packages/manager/cypress/e2e/core/delivery/create-destination.spec.ts b/packages/manager/cypress/e2e/core/delivery/create-destination.spec.ts new file mode 100644 index 00000000000..31c74fff140 --- /dev/null +++ b/packages/manager/cypress/e2e/core/delivery/create-destination.spec.ts @@ -0,0 +1,99 @@ +import { + mockDestination, + mockDestinationPayload, +} from 'support/constants/delivery'; +import { + mockCreateDestination, + mockGetDestinations, + mockTestConnection, +} from 'support/intercepts/delivery'; +import { mockAppendFeatureFlags } from 'support/intercepts/feature-flags'; +import { ui } from 'support/ui'; +import { logsDestinationForm } from 'support/ui/pages/logs-destination-form'; + +import type { AkamaiObjectStorageDetails } from '@linode/api-v4'; + +describe('Create Destination', () => { + before(() => { + mockAppendFeatureFlags({ + aclpLogs: { enabled: true, beta: true }, + }); + }); + + it('create destination with form', () => { + cy.visitWithLogin('/logs/delivery/destinations/create'); + + // Give Destination a label + logsDestinationForm.setLabel(mockDestinationPayload.label); + + logsDestinationForm.fillDestinationDetailsForm( + mockDestinationPayload.details as AkamaiObjectStorageDetails + ); + + // Create Destination should be disabled before test connection + cy.findByRole('button', { name: 'Create Destination' }).should( + 'be.disabled' + ); + + // Test connection of the destination form - failure + mockTestConnection(400); + ui.button + .findByTitle('Test Connection') + .should('be.enabled') + .should('have.attr', 'type', 'button') + .click(); + + ui.toast.assertMessage( + 'Delivery connection test failed. Verify your delivery settings and try again.' + ); + + // Create Destination should be disabled after test connection failed + cy.findByRole('button', { name: 'Create Destination' }).should( + 'be.disabled' + ); + + // Test connection of the destination form - success + mockTestConnection(200); + ui.button + .findByTitle('Test Connection') + .should('be.enabled') + .should('have.attr', 'type', 'button') + .click(); + + ui.toast.assertMessage( + `Delivery connection test completed successfully. Data can now be sent using this configuration.` + ); + + // Submit the destination create form - failure + mockCreateDestination({}, 400); + cy.findByRole('button', { name: 'Create Destination' }) + .should('be.enabled') + .should('have.attr', 'type', 'button') + .click(); + + ui.toast.assertMessage(`There was an issue creating your destination`); + + // Submit the destination create form - success + mockCreateDestination(mockDestination); + mockGetDestinations([mockDestination]); + cy.findByRole('button', { name: 'Create Destination' }) + .should('be.enabled') + .should('have.attr', 'type', 'button') + .click(); + + ui.toast.assertMessage( + `Destination ${mockDestination.label} created successfully` + ); + + // Verify we redirect to the destinations landing page upon successful creation + cy.url().should('endWith', 'destinations'); + + // Verify the newly created destination shows on the Destinations landing page + cy.findByText(mockDestination.label) + .closest('tr') + .within(() => { + // Verify Destination label shows + cy.findByText(mockDestination.label).should('be.visible'); + }); + }); +}); diff --git a/packages/manager/cypress/e2e/core/delivery/destinations-empty-landing-page.spec.ts b/packages/manager/cypress/e2e/core/delivery/destinations-empty-landing-page.spec.ts new file mode 100644 index 00000000000..ff8de40f562 --- /dev/null +++ b/packages/manager/cypress/e2e/core/delivery/destinations-empty-landing-page.spec.ts @@ -0,0 +1,37 @@ +import { mockGetDestinations } from 'support/intercepts/delivery'; +import { mockAppendFeatureFlags } from 'support/intercepts/feature-flags'; +import { ui } from 'support/ui'; + +describe('Destinations empty landing page', () => { + beforeEach(() => { + mockAppendFeatureFlags({ + aclpLogs: { + enabled: true, + beta: true, + }, + }); + }); + + /** + * - Confirms Destinations landing page empty state is shown when no Destinations are present: + * - Confirms that clicking "Create Destination" navigates user to create destination page. + */ + it('shows the empty state when there are no destinations', () => { + mockGetDestinations([]).as('getDestinations'); + + cy.visitWithLogin('/logs/delivery/destinations'); + cy.wait(['@getDestinations']); + + // Confirm empty Destinations Landing Text + cy.findByText('Create a destination for cloud logs').should('be.visible'); + + // confirms clicking on 'Create Domain' button + ui.button + .findByTitle('Create Destination') + .should('be.visible') + .should('be.enabled') + .click(); + + cy.url().should('endWith', '/logs/delivery/destinations/create'); + }); +}); diff --git a/packages/manager/cypress/e2e/core/delivery/destinations-non-empty-landing-page.spec.ts b/packages/manager/cypress/e2e/core/delivery/destinations-non-empty-landing-page.spec.ts new file mode 100644 index 00000000000..ea06005cebf --- /dev/null +++ b/packages/manager/cypress/e2e/core/delivery/destinations-non-empty-landing-page.spec.ts @@ -0,0 +1,154 @@ +import { + interceptDeleteDestination, + mockDeleteDestination, + mockGetDestination, + mockGetDestinations, +} from 'support/intercepts/delivery'; +import { mockAppendFeatureFlags } from 'support/intercepts/feature-flags'; +import { ui } from 'support/ui'; + +import { destinationFactory } from 'src/factories'; + +import type { Destination } from '@linode/api-v4'; + +function checkActionMenu(tableAlias: string, mockDestinations: Destination[]) { + mockDestinations.forEach((destination) => { + cy.get(tableAlias) + .find('tbody tr') + .should('contain', destination.label) + .then(() => { + // If the row contains the label, proceed with clicking the action menu + ui.actionMenu + .findByTitle(`Action menu for Destination ${destination.label}`) + .should('be.visible') + .click(); + + // Check that all items are enabled + ui.actionMenuItem + .findByTitle('Edit') + .should('be.visible') + .should('be.enabled'); + + ui.actionMenuItem + .findByTitle('Delete') + .should('be.visible') + .should('be.enabled'); + }); + + // Close the action menu by clicking on Delivery Title of the screen + cy.get('body').click(0, 0); + }); +} + +function deleteItem(tableAlias: string, destination: Destination) { + cy.get(tableAlias) + .find('tbody tr') + .should('contain', destination.label) + .then(() => { + // If the row contains the label, proceed with clicking the action menu + ui.actionMenu + .findByTitle(`Action menu for Destination ${destination.label}`) + .should('be.visible') + .click(); + + mockDeleteDestination(404); // @TODO remove after API release on prod + interceptDeleteDestination().as('deleteDestination'); + + // Delete destination + ui.actionMenuItem.findByTitle('Delete').click(); + + // Find confirmation modal + cy.findByText( + `Are you sure you want to delete "${destination.label}" destination?` + ); + ui.button.findByTitle('Delete').click(); + + cy.wait('@deleteDestination'); + + // Close confirmation modal after failure + ui.button.findByTitle('Cancel').click(); + }); +} + +function editItemViaActionMenu(tableAlias: string, destination: Destination) { + cy.get(tableAlias) + .find('tbody tr') + .should('contain', destination.label) + .then(() => { + // If the row contains the label, proceed with clicking the action menu + ui.actionMenu + .findByTitle(`Action menu for Destination ${destination.label}`) + .should('be.visible') + .click(); + + mockGetDestination(destination); + // Edit destination redirect + ui.actionMenuItem.findByTitle('Edit').click(); + cy.url().should('endWith', `/destinations/${destination.id}/edit`); + }); +} + +const mockDestinations: Destination[] = new Array(3) + .fill(null) + .map((_item: null, index: number): Destination => { + return destinationFactory.build({ + label: `Destination ${index}`, + }); + }); + +describe('destinations landing checks for non-empty state', () => { + beforeEach(() => { + mockAppendFeatureFlags({ + aclpLogs: { enabled: true, beta: true }, + }); + + // Mock setup to display the Destinations landing page in a non-empty state + mockGetDestinations(mockDestinations).as('getDestinations'); + + // Alias the mockDestinations array + cy.wrap(mockDestinations).as('mockDestinations'); + }); + + it('checks create destination button is enabled and user can see existing destinations', () => { + // Login and wait for application to load + cy.visitWithLogin('/logs/delivery/destinations'); + cy.wait('@getDestinations'); + cy.url().should('endWith', '/destinations'); + + cy.get('table').should('exist').as('destinationsTable'); + + // Assert that Create Destination button is visible and enabled + ui.button + .findByTitle('Create Destination') + .should('be.visible') + .and('be.enabled'); + + // Assert that the correct number of Destinations entries are present in the DestinationsTable + cy.get('@destinationsTable') + .find('tbody tr') + .should('have.length', mockDestinations.length); + + checkActionMenu('@destinationsTable', mockDestinations); // For the recovery destination table + }); + + it('checks actions from destination menu actions', () => { + cy.visitWithLogin('/logs/delivery/destinations'); + cy.wait('@getDestinations'); + cy.get('table').should('exist').as('destinationsTable'); + + const exampleDestination = mockDestinations[0]; + deleteItem('@destinationsTable', exampleDestination); + + mockGetDestination(exampleDestination).as('getDestination'); + + // Redirect to destination edit page via name + cy.findByText(exampleDestination.label).click(); + cy.url().should('endWith', `/destinations/${exampleDestination.id}/edit`); + cy.wait('@getDestination'); + + cy.visit('/logs/delivery/destinations'); + cy.get('table').should('exist').as('destinationsTable'); + cy.wait('@getDestinations'); + editItemViaActionMenu('@destinationsTable', exampleDestination); + }); +}); diff --git a/packages/manager/cypress/e2e/core/delivery/edit-destination.spec.ts b/packages/manager/cypress/e2e/core/delivery/edit-destination.spec.ts new file mode 100644 index 00000000000..2f458580034 --- /dev/null +++ b/packages/manager/cypress/e2e/core/delivery/edit-destination.spec.ts @@ -0,0 +1,110 @@ +import { + mockDestination, + mockDestinationPayload, +} from 'support/constants/delivery'; +import { + mockGetDestination, + mockGetDestinations, + mockTestConnection, + mockUpdateDestination, +} from 'support/intercepts/delivery'; +import { mockAppendFeatureFlags } from 'support/intercepts/feature-flags'; +import { ui } from 'support/ui'; +import { logsDestinationForm } from 'support/ui/pages/logs-destination-form'; +import { randomLabel } from 'support/util/random'; + +import { getDestinationTypeOption } from 'src/features/Delivery/deliveryUtils'; + +import type { AkamaiObjectStorageDetails } from '@linode/api-v4'; + +describe('Edit Destination', () => { + beforeEach(() => { + mockAppendFeatureFlags({ + aclpLogs: { enabled: true, beta: true }, + }); + cy.visitWithLogin(`/logs/delivery/destinations/${mockDestination.id}/edit`); + mockGetDestination(mockDestination); + }); + + it('destination type edit should be disabled', () => { + cy.findByLabelText('Destination Type') + .should('be.visible') + .should('be.disabled') + .should( + 'have.attr', + 'value', + getDestinationTypeOption(mockDestination.type)?.label + ); + }); + + it('edit destination with incorrect data', () => { + logsDestinationForm.fillDestinationDetailsForm( + mockDestinationPayload.details as AkamaiObjectStorageDetails + ); + + // Create Destination should be disabled before test connection + cy.findByRole('button', { name: 'Edit Destination' }).should('be.disabled'); + // Test connection of the destination form + mockTestConnection(400); + ui.button + .findByTitle('Test Connection') + .should('be.enabled') + .should('have.attr', 'type', 'button') + .click(); + + ui.toast.assertMessage( + 'Delivery connection test failed. Verify your delivery settings and try again.' + ); + + // Create Destination should be disabled after test connection failed + cy.findByRole('button', { name: 'Edit Destination' }).should('be.disabled'); + }); + + it('edit destination with correct data', () => { + const newLabel = randomLabel(); + // Give Destination a new label + logsDestinationForm.setLabel(newLabel); + + logsDestinationForm.fillDestinationDetailsForm( + mockDestinationPayload.details as AkamaiObjectStorageDetails + ); + + // Create Destination should be disabled before test connection + cy.findByRole('button', { name: 'Edit Destination' }).should('be.disabled'); + // Test connection of the destination form + mockTestConnection(); + ui.button + .findByTitle('Test Connection') + .should('be.enabled') + .should('have.attr', 'type', 'button') + .click(); + + ui.toast.assertMessage( + `Delivery connection test completed successfully. Data can now be sent using this configuration.` + ); + + const updatedDestination = { ...mockDestination, label: newLabel }; + mockUpdateDestination(mockDestination, updatedDestination); + mockGetDestinations([updatedDestination]); + // Submit the destination edit form + cy.findByRole('button', { name: 'Edit Destination' }) + .should('be.enabled') + .should('have.attr', 'type', 'button') + .click(); + + ui.toast.assertMessage( + `Destination ${updatedDestination.label} edited successfully` + ); + + // Verify we redirect to the destinations landing page upon successful edit + cy.url().should('endWith', 'destinations'); + + // Verify the edited destination shows on the Destinations landing page + cy.findByText(newLabel) + .closest('tr') + .within(() => { + // Verify Destination label shows + cy.findByText(newLabel).should('be.visible'); + }); + }); +}); diff --git a/packages/manager/cypress/support/api/delivery.ts b/packages/manager/cypress/support/api/delivery.ts new file mode 100644 index 00000000000..d251e9f1cb8 --- /dev/null +++ b/packages/manager/cypress/support/api/delivery.ts @@ -0,0 +1,45 @@ +import { + deleteDestination, + deleteStream, + getDestinations, + getStreams, +} from '@linode/api-v4'; +import { isTestLabel } from 'support/api/common'; +import { pageSize } from 'support/constants/api'; +import { depaginate } from 'support/util/paginate'; + +import type { Destination, Stream } from '@linode/api-v4'; + +/** + * Deletes all destinations which are prefixed with the test entity prefix. + * + * @returns Promise that resolves when destinations have been deleted. + */ +export const deleteAllTestDestinations = async (): Promise => { + const destinations = await depaginate((page: number) => + getDestinations({ page, page_size: pageSize }) + ); + + const deletionPromises = destinations + .filter((destination: Destination) => isTestLabel(destination.label)) + .map((destination: Destination) => deleteDestination(destination.id)); + + await Promise.all(deletionPromises); +}; + +/** + * Deletes all streams which are prefixed with the test entity prefix. + * + * @returns Promise that resolves when streams have been deleted. + */ +export const deleteAllTestStreams = async (): Promise => { + const streams = await depaginate((page: number) => + getStreams({ page, page_size: pageSize }) + ); + + const deletionPromises = streams + .filter((destination: Stream) => isTestLabel(destination.label)) + .map((destination: Stream) => deleteStream(destination.id)); + + await Promise.all(deletionPromises); +}; diff --git a/packages/manager/cypress/support/constants/delivery.ts b/packages/manager/cypress/support/constants/delivery.ts new file mode 100644 index 00000000000..e2be89d8c08 --- /dev/null +++ b/packages/manager/cypress/support/constants/delivery.ts @@ -0,0 +1,32 @@ +import { destinationType } from '@linode/api-v4'; +import { randomLabel, randomString } from 'support/util/random'; + +import { destinationFactory } from 'src/factories'; + +import type { Destination } from '@linode/api-v4'; + +export const regions = [ + { + id: 'pl-labkrk-2', + label: 'PL, Krakow (pl-labkrk-2)', + }, +]; + +export const mockDestinationPayload = { + label: randomLabel(), + type: destinationType.AkamaiObjectStorage, + details: { + host: randomString(), + bucket_name: randomString(), + region: 'pl-labkrk-2', + access_key_id: randomString(), + access_key_secret: randomString(), + path: '/', + }, +}; + +export const mockDestination: Destination = destinationFactory.build({ + id: 1290, + ...mockDestinationPayload, + version: '1.0', +}); diff --git a/packages/manager/cypress/support/intercepts/delivery.ts b/packages/manager/cypress/support/intercepts/delivery.ts new file mode 100644 index 00000000000..03dff6f8db8 --- /dev/null +++ b/packages/manager/cypress/support/intercepts/delivery.ts @@ -0,0 +1,136 @@ +/** + * @file Cypress intercepts and mocks for Logs Delivery API requests. + */ + +import { apiMatcher } from 'support/util/intercepts'; +import { paginateResponse } from 'support/util/paginate'; +import { makeResponse } from 'support/util/response'; + +import type { + Destination, + UpdateDestinationPayloadWithId, +} from '@linode/api-v4'; + +/** + * Intercepts GET request to fetch destination instance and mocks response. + * + * @param destination - Response destinations. + * + * @returns Cypress chainable. + */ +export const mockGetDestination = ( + destination: Destination +): Cypress.Chainable => { + return cy.intercept( + 'GET', + apiMatcher(`monitor/streams/destinations/${destination.id}`), + makeResponse(destination) + ); +}; + +/** + * Intercepts GET request to mock destination data. + * + * @param destinations - an array of mock destination objects. + * + * @returns Cypress chainable. + */ +export const mockGetDestinations = ( + destinations: Destination[] +): Cypress.Chainable => { + return cy.intercept( + 'GET', + apiMatcher('monitor/streams/destinations*'), + paginateResponse(destinations) + ); +}; + +/** + * Intercepts POST request to create a Destination record. + * + * @returns Cypress chainable. + */ +export const interceptCreateDestination = (): Cypress.Chainable => { + return cy.intercept('POST', apiMatcher('monitor/streams/destinations*')); +}; + +/** + * Intercepts DELETE request to delete Destination record. + * + * @returns Cypress chainable. + */ +export const interceptDeleteDestination = (): Cypress.Chainable => { + return cy.intercept('DELETE', apiMatcher(`monitor/streams/destinations/*`)); +}; + +/** + * Intercepts PUT request to update a destination and mocks response. + * + * @param destination - Destination data to update. + * @param responseBody - Full updated destination object. + * + * @returns Cypress chainable. + */ +export const mockUpdateDestination = ( + destination: UpdateDestinationPayloadWithId, + responseBody: Destination +): Cypress.Chainable => { + return cy.intercept( + 'PUT', + apiMatcher(`monitor/streams/destinations/${destination.id}`), + makeResponse(responseBody) + ); +}; + +/** + * Intercepts POST request to create a destination and mocks response. + * + * @param responseCode + * @param responseBody - Full destination object returned when created. + * + * @returns Cypress chainable. + */ +export const mockCreateDestination = ( + responseBody = {}, + responseCode = 200 +): Cypress.Chainable => { + return cy.intercept( + 'POST', + apiMatcher(`monitor/streams/destinations`), + makeResponse(responseBody ?? {}, responseCode) + ); +}; + +/** + * Intercepts POST request to verify destination connection. + * + * @param responseCode - status code of the response. + * @param responseBody - response body content. + * + * @returns Cypress chainable. + */ +export const mockTestConnection = ( + responseCode = 200, + responseBody = {} +): Cypress.Chainable => { + return cy.intercept( + 'POST', + apiMatcher(`monitor/streams/destinations/verify`), + makeResponse(responseBody, responseCode) + ); +}; + +/** + * Intercept DELETE mock request to delete a Destination record. + * + * @returns Cypress chainable. + */ +export const mockDeleteDestination = ( + responseCode = 200 +): Cypress.Chainable => { + return cy.intercept( + 'DELETE', + apiMatcher(`monitor/streams/destinations/*`), + makeResponse({}, responseCode) + ); +}; diff --git a/packages/manager/cypress/support/ui/pages/logs-destination-form.ts b/packages/manager/cypress/support/ui/pages/logs-destination-form.ts new file mode 100644 index 00000000000..8c1f4dc7c8b --- /dev/null +++ b/packages/manager/cypress/support/ui/pages/logs-destination-form.ts @@ -0,0 +1,98 @@ +/** + * @file Page utilities for Logs Delivery Destination Form. + * Create/Edit Destination Page + * Create/Edit Stream Page + */ + +import type { AkamaiObjectStorageDetails } from '@linode/api-v4'; + +export const logsDestinationForm = { + /** + * Sets destination's label + * + * @param label - destination label to set + */ + setLabel: (label: string) => { + cy.findByLabelText('Destination Name') + .should('be.visible') + .should('be.enabled') + .should('have.attr', 'placeholder', 'Destination Name') + .clear(); + cy.focused().type(label); + }, + + /** + * Sets destination's host + * + * @param host - destination host to set + */ + setHost: (host: string) => { + cy.findByLabelText('Host') + .should('be.visible') + .should('be.enabled') + .should('have.attr', 'placeholder', 'Host') + .clear(); + cy.focused().type(host); + }, + + /** + * Sets destination's bucket name + * + * @param bucketName - destination bucket name to set + */ + setBucket: (bucketName: string) => { + cy.findByLabelText('Bucket') + .should('be.visible') + .should('be.enabled') + .should('have.attr', 'placeholder', 'Bucket') + .clear(); + cy.focused().type(bucketName); + }, + + /** + * Sets destination's Access Key ID + * + * @param accessKeyId - destination access key id to set + */ + setAccessKeyId: (accessKeyId: string) => { + cy.findByLabelText('Access Key ID') + .should('be.visible') + .should('be.enabled') + .should('have.attr', 'placeholder', 'Access Key ID') + .clear(); + cy.focused().type(accessKeyId); + }, + + /** + * Sets destination's Secret Access Key + * + * @param secretAccessKey - destination secret access key to set + */ + setSecretAccessKey: (secretAccessKey: string) => { + cy.findByLabelText('Secret Access Key') + .should('be.visible') + .should('be.enabled') + .should('have.attr', 'placeholder', 'Secret Access Key') + .clear(); + cy.focused().type(secretAccessKey); + }, + + /** + * Fills all form fields related to destination's details (LinodeObjectStorageDetails type) + * + * @param data - object with destination details of LinodeObjectStorageDetails type + */ + fillDestinationDetailsForm: (data: AkamaiObjectStorageDetails) => { + // Give Destination a host + logsDestinationForm.setHost(data.host); + + // Give Destination a bucket + logsDestinationForm.setBucket(data.bucket_name); + + // Give the Destination Access Key ID + logsDestinationForm.setAccessKeyId(data.access_key_id); + + // Give the Destination Secret Access Key + logsDestinationForm.setSecretAccessKey(data.access_key_secret); + }, +}; diff --git a/packages/manager/cypress/support/util/cleanup.ts b/packages/manager/cypress/support/util/cleanup.ts index 3dd61106092..11432ce0ff7 100644 --- a/packages/manager/cypress/support/util/cleanup.ts +++ b/packages/manager/cypress/support/util/cleanup.ts @@ -1,3 +1,4 @@ +import { deleteAllTestDestinations } from 'support/api/delivery'; import { deleteAllTestDomains } from 'support/api/domains'; import { cancelAllTestEntityTransfers } from 'support/api/entityTransfer'; import { deleteAllTestFirewalls } from 'support/api/firewalls'; @@ -17,6 +18,7 @@ import { deleteAllTestVolumes } from 'support/api/volumes'; /** Types of resources that can be cleaned up. */ export type CleanUpResource = + | 'destinations' | 'domains' | 'firewalls' | 'images' @@ -39,6 +41,7 @@ type CleanUpMap = { // Map `CleanUpResource` strings to the clean up functions they execute. const cleanUpMap: CleanUpMap = { + destinations: () => deleteAllTestDestinations(), domains: () => deleteAllTestDomains(), firewalls: () => deleteAllTestFirewalls(), images: () => deleteAllTestImages(), diff --git a/packages/manager/src/factories/index.ts b/packages/manager/src/factories/index.ts index a6556176da2..d075b7f42c7 100644 --- a/packages/manager/src/factories/index.ts +++ b/packages/manager/src/factories/index.ts @@ -13,6 +13,7 @@ export * from './cloudpulse/channels'; export * from './cloudpulse/services'; export * from './dashboards'; export * from './databases'; +export * from './delivery'; export * from './disk'; export * from './domain'; export * from './entityTransfers'; diff --git a/packages/manager/src/features/Delivery/Destinations/DestinationActionMenu.test.tsx b/packages/manager/src/features/Delivery/Destinations/DestinationActionMenu.test.tsx index c5d6537d8b3..9c1c6b0662b 100644 --- a/packages/manager/src/features/Delivery/Destinations/DestinationActionMenu.test.tsx +++ b/packages/manager/src/features/Delivery/Destinations/DestinationActionMenu.test.tsx @@ -2,7 +2,7 @@ import { screen } from '@testing-library/react'; import { userEvent } from '@testing-library/user-event'; import * as React from 'react'; -import { destinationFactory } from 'src/factories/delivery'; +import { destinationFactory } from 'src/factories'; import { DestinationActionMenu } from 'src/features/Delivery/Destinations/DestinationActionMenu'; import { renderWithTheme } from 'src/utilities/testHelpers'; diff --git a/packages/manager/src/features/Delivery/Destinations/DestinationForm/DestinationEdit.test.tsx b/packages/manager/src/features/Delivery/Destinations/DestinationForm/DestinationEdit.test.tsx index d0a24d6e7da..da08e80ad6d 100644 --- a/packages/manager/src/features/Delivery/Destinations/DestinationForm/DestinationEdit.test.tsx +++ b/packages/manager/src/features/Delivery/Destinations/DestinationForm/DestinationEdit.test.tsx @@ -7,7 +7,7 @@ import userEvent from '@testing-library/user-event'; import React from 'react'; import { describe, expect } from 'vitest'; -import { destinationFactory } from 'src/factories/delivery'; +import { destinationFactory } from 'src/factories'; import { DestinationEdit } from 'src/features/Delivery/Destinations/DestinationForm/DestinationEdit'; import { http, HttpResponse, server } from 'src/mocks/testServer'; import { renderWithThemeAndHookFormContext } from 'src/utilities/testHelpers'; diff --git a/packages/manager/src/features/Delivery/Destinations/DestinationsLanding.test.tsx b/packages/manager/src/features/Delivery/Destinations/DestinationsLanding.test.tsx index 767f1acb704..1e11744834b 100644 --- a/packages/manager/src/features/Delivery/Destinations/DestinationsLanding.test.tsx +++ b/packages/manager/src/features/Delivery/Destinations/DestinationsLanding.test.tsx @@ -3,7 +3,7 @@ import userEvent from '@testing-library/user-event'; import * as React from 'react'; import { beforeEach, describe, expect } from 'vitest'; -import { destinationFactory } from 'src/factories/delivery'; +import { destinationFactory } from 'src/factories'; import { DestinationsLanding } from 'src/features/Delivery/Destinations/DestinationsLanding'; import { mockMatchMedia, renderWithTheme } from 'src/utilities/testHelpers'; diff --git a/packages/manager/src/features/Delivery/Streams/StreamActionMenu.test.tsx b/packages/manager/src/features/Delivery/Streams/StreamActionMenu.test.tsx index b928293fbf8..11b6614aaab 100644 --- a/packages/manager/src/features/Delivery/Streams/StreamActionMenu.test.tsx +++ b/packages/manager/src/features/Delivery/Streams/StreamActionMenu.test.tsx @@ -2,7 +2,7 @@ import { screen } from '@testing-library/react'; import { userEvent } from '@testing-library/user-event'; import * as React from 'react'; -import { streamFactory } from 'src/factories/delivery'; +import { streamFactory } from 'src/factories'; import { StreamActionMenu } from 'src/features/Delivery/Streams/StreamActionMenu'; import { renderWithTheme } from 'src/utilities/testHelpers'; diff --git a/packages/manager/src/features/Delivery/Streams/StreamForm/Delivery/StreamFormDelivery.test.tsx b/packages/manager/src/features/Delivery/Streams/StreamForm/Delivery/StreamFormDelivery.test.tsx index 9b54a76803e..e9a6efec52e 100644 --- a/packages/manager/src/features/Delivery/Streams/StreamForm/Delivery/StreamFormDelivery.test.tsx +++ b/packages/manager/src/features/Delivery/Streams/StreamForm/Delivery/StreamFormDelivery.test.tsx @@ -4,7 +4,7 @@ import userEvent from '@testing-library/user-event'; import React from 'react'; import { beforeEach, describe, expect } from 'vitest'; -import { destinationFactory } from 'src/factories/delivery'; +import { destinationFactory } from 'src/factories'; import { makeResourcePage } from 'src/mocks/serverHandlers'; import { http, HttpResponse, server } from 'src/mocks/testServer'; import { renderWithThemeAndHookFormContext } from 'src/utilities/testHelpers'; diff --git a/packages/manager/src/features/Delivery/Streams/StreamForm/StreamCreate.test.tsx b/packages/manager/src/features/Delivery/Streams/StreamForm/StreamCreate.test.tsx index 98026b543cf..54c4fbc14df 100644 --- a/packages/manager/src/features/Delivery/Streams/StreamForm/StreamCreate.test.tsx +++ b/packages/manager/src/features/Delivery/Streams/StreamForm/StreamCreate.test.tsx @@ -4,7 +4,7 @@ import userEvent from '@testing-library/user-event'; import React from 'react'; import { describe, expect } from 'vitest'; -import { destinationFactory } from 'src/factories/delivery'; +import { destinationFactory } from 'src/factories'; import { StreamCreate } from 'src/features/Delivery/Streams/StreamForm/StreamCreate'; import { makeResourcePage } from 'src/mocks/serverHandlers'; import { http, HttpResponse, server } from 'src/mocks/testServer'; diff --git a/packages/manager/src/features/Delivery/Streams/StreamForm/StreamEdit.test.tsx b/packages/manager/src/features/Delivery/Streams/StreamForm/StreamEdit.test.tsx index eb6c4c4130d..8dabe744d53 100644 --- a/packages/manager/src/features/Delivery/Streams/StreamForm/StreamEdit.test.tsx +++ b/packages/manager/src/features/Delivery/Streams/StreamForm/StreamEdit.test.tsx @@ -7,7 +7,7 @@ import userEvent from '@testing-library/user-event'; import React from 'react'; import { describe, expect } from 'vitest'; -import { destinationFactory, streamFactory } from 'src/factories/delivery'; +import { destinationFactory, streamFactory } from 'src/factories'; import { StreamEdit } from 'src/features/Delivery/Streams/StreamForm/StreamEdit'; import { makeResourcePage } from 'src/mocks/serverHandlers'; import { http, HttpResponse, server } from 'src/mocks/testServer'; diff --git a/packages/manager/src/features/Delivery/Streams/StreamTableRow.test.tsx b/packages/manager/src/features/Delivery/Streams/StreamTableRow.test.tsx index 31e4a47f390..a30c4e6bc0f 100644 --- a/packages/manager/src/features/Delivery/Streams/StreamTableRow.test.tsx +++ b/packages/manager/src/features/Delivery/Streams/StreamTableRow.test.tsx @@ -3,7 +3,7 @@ import userEvent from '@testing-library/user-event'; import React from 'react'; import { beforeEach, describe, expect } from 'vitest'; -import { streamFactory } from 'src/factories/delivery'; +import { streamFactory } from 'src/factories'; import { StreamTableRow } from 'src/features/Delivery/Streams/StreamTableRow'; import { mockMatchMedia, diff --git a/packages/manager/src/features/Delivery/Streams/StreamsLanding.test.tsx b/packages/manager/src/features/Delivery/Streams/StreamsLanding.test.tsx index f0eefa3c63c..0c9641e1178 100644 --- a/packages/manager/src/features/Delivery/Streams/StreamsLanding.test.tsx +++ b/packages/manager/src/features/Delivery/Streams/StreamsLanding.test.tsx @@ -3,7 +3,7 @@ import userEvent from '@testing-library/user-event'; import * as React from 'react'; import { beforeEach, describe, expect } from 'vitest'; -import { streamFactory } from 'src/factories/delivery'; +import { streamFactory } from 'src/factories'; import { StreamsLanding } from 'src/features/Delivery/Streams/StreamsLanding'; import { mockMatchMedia, renderWithTheme } from 'src/utilities/testHelpers'; diff --git a/packages/manager/src/mocks/presets/crud/handlers/delivery.ts b/packages/manager/src/mocks/presets/crud/handlers/delivery.ts index a5729b908bf..50d8208811c 100644 --- a/packages/manager/src/mocks/presets/crud/handlers/delivery.ts +++ b/packages/manager/src/mocks/presets/crud/handlers/delivery.ts @@ -2,7 +2,7 @@ import { destinationType } from '@linode/api-v4'; import { DateTime } from 'luxon'; import { http } from 'msw'; -import { destinationFactory, streamFactory } from 'src/factories/delivery'; +import { destinationFactory, streamFactory } from 'src/factories'; import { mswDB } from 'src/mocks/indexedDB'; import { queueEvents } from 'src/mocks/utilities/events'; import {