Skip to content

Commit 1640efd

Browse files
committed
DPS-34824 update after changes - Region field removed and delete confirmation modal added
1 parent 8dab0ff commit 1640efd

File tree

5 files changed

+18
-36
lines changed

5 files changed

+18
-36
lines changed

packages/manager/cypress/e2e/core/delivery/create-destination.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import { mockAppendFeatureFlags } from 'support/intercepts/feature-flags';
1111
import { ui } from 'support/ui';
1212
import { logsDestinationForm } from 'support/ui/pages/logs-destination-form';
1313

14-
import type { LinodeObjectStorageDetails } from '@linode/api-v4';
14+
import type { AkamaiObjectStorageDetails } from '@linode/api-v4';
1515

1616
describe('Create Destination', () => {
1717
before(() => {
@@ -27,7 +27,7 @@ describe('Create Destination', () => {
2727
logsDestinationForm.setLabel(mockDestinationPayload.label);
2828

2929
logsDestinationForm.fillDestinationDetailsForm(
30-
mockDestinationPayload.details as LinodeObjectStorageDetails
30+
mockDestinationPayload.details as AkamaiObjectStorageDetails
3131
);
3232

3333
// Create Destination should be disabled before test connection

packages/manager/cypress/e2e/core/delivery/destinations-non-empty-landing-page.spec.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,17 @@ function deleteItem(tableAlias: string, destination: Destination) {
5454

5555
// Delete destination
5656
ui.actionMenuItem.findByTitle('Delete').click();
57+
58+
// Find confirmation modal
59+
cy.findByText(
60+
`Are you sure you want to delete "${destination.label}" destination?`
61+
);
62+
ui.button.findByTitle('Delete').click();
63+
5764
cy.wait('@deleteDestination');
65+
66+
// Close confirmation modal after failure
67+
ui.button.findByTitle('Cancel').click();
5868
});
5969
}
6070

packages/manager/cypress/e2e/core/delivery/edit-destination.spec.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import { randomLabel } from 'support/util/random';
1515

1616
import { getDestinationTypeOption } from 'src/features/Delivery/deliveryUtils';
1717

18-
import type { LinodeObjectStorageDetails } from '@linode/api-v4';
18+
import type { AkamaiObjectStorageDetails } from '@linode/api-v4';
1919

2020
describe('Edit Destination', () => {
2121
beforeEach(() => {
@@ -39,7 +39,7 @@ describe('Edit Destination', () => {
3939

4040
it('edit destination with incorrect data', () => {
4141
logsDestinationForm.fillDestinationDetailsForm(
42-
mockDestinationPayload.details as LinodeObjectStorageDetails
42+
mockDestinationPayload.details as AkamaiObjectStorageDetails
4343
);
4444

4545
// Create Destination should be disabled before test connection
@@ -66,7 +66,7 @@ describe('Edit Destination', () => {
6666
logsDestinationForm.setLabel(newLabel);
6767

6868
logsDestinationForm.fillDestinationDetailsForm(
69-
mockDestinationPayload.details as LinodeObjectStorageDetails
69+
mockDestinationPayload.details as AkamaiObjectStorageDetails
7070
);
7171

7272
// Create Destination should be disabled before test connection

packages/manager/cypress/support/constants/delivery.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ export const regions = [
1414

1515
export const mockDestinationPayload = {
1616
label: randomLabel(),
17-
type: destinationType.LinodeObjectStorage,
17+
type: destinationType.AkamaiObjectStorage,
1818
details: {
1919
host: randomString(),
2020
bucket_name: randomString(),

packages/manager/cypress/support/ui/pages/logs-destination-form.ts

Lines changed: 2 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
1-
import { regions } from 'support/constants/delivery';
21
/**
32
* @file Page utilities for Logs Delivery Destination Form.
43
* Create/Edit Destination Page
54
* Create/Edit Stream Page
65
*/
7-
import { ui } from 'support/ui';
86

9-
import type { LinodeObjectStorageDetails } from '@linode/api-v4';
7+
import type { AkamaiObjectStorageDetails } from '@linode/api-v4';
108

119
export const logsDestinationForm = {
1210
/**
@@ -51,26 +49,6 @@ export const logsDestinationForm = {
5149
cy.focused().type(bucketName);
5250
},
5351

54-
/**
55-
* Selects destination's region
56-
*
57-
* @param region - region to select
58-
*/
59-
selectRegion: (region: string) => {
60-
// Find Region select and open it
61-
cy.findByLabelText('Region')
62-
.should('be.visible')
63-
.should('be.enabled')
64-
.should('have.attr', 'placeholder', 'Select a Region')
65-
.clear();
66-
// Select the Region
67-
ui.autocompletePopper
68-
.findByTitle(getRegionLabel(region))
69-
.should('be.visible')
70-
.should('be.enabled')
71-
.click();
72-
},
73-
7452
/**
7553
* Sets destination's Access Key ID
7654
*
@@ -104,23 +82,17 @@ export const logsDestinationForm = {
10482
*
10583
* @param data - object with destination details of LinodeObjectStorageDetails type
10684
*/
107-
fillDestinationDetailsForm: (data: LinodeObjectStorageDetails) => {
85+
fillDestinationDetailsForm: (data: AkamaiObjectStorageDetails) => {
10886
// Give Destination a host
10987
logsDestinationForm.setHost(data.host);
11088

11189
// Give Destination a bucket
11290
logsDestinationForm.setBucket(data.bucket_name);
11391

114-
// Find Region select and open it
115-
logsDestinationForm.selectRegion(data.region);
116-
11792
// Give the Destination Access Key ID
11893
logsDestinationForm.setAccessKeyId(data.access_key_id);
11994

12095
// Give the Destination Secret Access Key
12196
logsDestinationForm.setSecretAccessKey(data.access_key_secret);
12297
},
12398
};
124-
125-
const getRegionLabel = (regionId: string): string =>
126-
regions.find(({ id }) => id === regionId)?.label ?? '';

0 commit comments

Comments
 (0)