Skip to content

Commit c355462

Browse files
committed
test: [DPS-34825] Update tests after recent changes
1 parent ea20db9 commit c355462

File tree

4 files changed

+58
-53
lines changed

4 files changed

+58
-53
lines changed

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

Lines changed: 28 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -122,13 +122,13 @@ describe('Create Stream', () => {
122122
// Select existing destination
123123
logsStreamForm.selectExistingDestination(mockDestination.label);
124124

125-
// Test Connection should be enabled
125+
// Test Connection should be disabled for existing destination
126126
ui.button
127127
.findByTitle('Test Connection')
128-
.should('be.enabled')
128+
.should('be.disabled')
129129
.should('have.attr', 'type', 'button');
130130

131-
// Create Stream should be enabled without testing connection for existing destination
131+
// Create Stream should be enabled
132132
cy.findByRole('button', { name: 'Create Stream' })
133133
.should('be.enabled')
134134
.should('have.attr', 'type', 'button');
@@ -223,32 +223,33 @@ describe('Create Stream', () => {
223223
logsStreamForm.findClusterCheckbox('cluster-3').should('be.checked');
224224
cy.findByLabelText('Toggle cluster-2 cluster').should('be.disabled');
225225

226+
// TODO: uncomment when "Automatically include all existing and recently configured clusters" feature is available
226227
// Use "Toggle all clusters" to unselect all eligible clusters
227-
logsStreamForm.findClusterCheckbox('all').uncheck();
228-
logsStreamForm.findClusterCheckbox('all').should('not.be.checked');
229-
logsStreamForm.findClusterCheckbox('cluster-1').should('not.be.checked');
230-
logsStreamForm.findClusterCheckbox('cluster-3').should('not.be.checked');
228+
// logsStreamForm.findClusterCheckbox('all').uncheck();
229+
// logsStreamForm.findClusterCheckbox('all').should('not.be.checked');
230+
// logsStreamForm.findClusterCheckbox('cluster-1').should('not.be.checked');
231+
// logsStreamForm.findClusterCheckbox('cluster-3').should('not.be.checked');
231232

232233
// Use "Automatically include all existing and recently configured clusters" to select all eligible clusters
233-
cy.findByLabelText(
234-
'Automatically include all existing and recently configured clusters.'
235-
)
236-
.should('exist')
237-
.should('be.enabled');
238-
cy.findByLabelText(
239-
'Automatically include all existing and recently configured clusters.'
240-
).click();
241-
242-
logsStreamForm.findClusterCheckbox('all').should('be.disabled');
243-
logsStreamForm
244-
.findClusterCheckbox('cluster-1')
245-
.should('be.disabled')
246-
.should('be.checked');
247-
logsStreamForm
248-
.findClusterCheckbox('cluster-3')
249-
.should('be.disabled')
250-
.should('be.checked');
251-
cy.findByLabelText('Toggle cluster-2 cluster').should('be.disabled');
234+
// cy.findByLabelText(
235+
// 'Automatically include all existing and recently configured clusters.'
236+
// )
237+
// .should('exist')
238+
// .should('be.enabled');
239+
// cy.findByLabelText(
240+
// 'Automatically include all existing and recently configured clusters.'
241+
// ).click();
242+
//
243+
// logsStreamForm.findClusterCheckbox('all').should('be.disabled');
244+
// logsStreamForm
245+
// .findClusterCheckbox('cluster-1')
246+
// .should('be.disabled')
247+
// .should('be.checked');
248+
// logsStreamForm
249+
// .findClusterCheckbox('cluster-3')
250+
// .should('be.disabled')
251+
// .should('be.checked');
252+
// cy.findByLabelText('Toggle cluster-2 cluster').should('be.disabled');
252253

253254
// Select existing destination
254255
logsStreamForm.selectExistingDestination(mockDestination.label);
@@ -269,7 +270,7 @@ describe('Create Stream', () => {
269270
type: streamType.LKEAuditLogs,
270271
destinations: [mockDestination.id],
271272
details: {
272-
is_auto_add_all_clusters_enabled: true,
273+
cluster_ids: [1, 3], // TODO: change to is_auto_add_all_clusters_enabled: true when "Automatically include all existing and recently configured clusters" feature is available
273274
},
274275
});
275276
});

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

Lines changed: 21 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,8 @@ describe('Edit Stream', () => {
6565
// Edit Stream button should be enabled initially
6666
ui.button.findByTitle('Edit Stream').should('be.enabled');
6767

68-
// Test connection button should be enabled
69-
ui.button.findByTitle('Test Connection').should('be.enabled');
68+
// Test Connection should be disabled for existing destination
69+
ui.button.findByTitle('Test Connection').should('be.disabled');
7070

7171
const newDestinationLabel = randomLabel();
7272
// Change Destination to a new one
@@ -206,20 +206,23 @@ describe('Edit Stream', () => {
206206
logsStreamForm.findClusterCheckbox('cluster-1').should('not.be.checked');
207207
logsStreamForm.findClusterCheckbox('cluster-3').should('not.be.checked');
208208

209-
// Enable auto-add all clusters
210-
cy.findByLabelText(
211-
'Automatically include all existing and recently configured clusters.'
212-
).click();
213-
214-
logsStreamForm.findClusterCheckbox('all').should('be.disabled');
215-
logsStreamForm
216-
.findClusterCheckbox('cluster-1')
217-
.should('be.disabled')
218-
.should('be.checked');
219-
logsStreamForm
220-
.findClusterCheckbox('cluster-3')
221-
.should('be.disabled')
222-
.should('be.checked');
209+
// TODO: uncomment when "Automatically include all existing and recently configured clusters" feature is available
210+
// Use "Automatically include all existing and recently configured clusters" to select all eligible clusters
211+
// cy.findByLabelText(
212+
// 'Automatically include all existing and recently configured clusters.'
213+
// ).click();
214+
// logsStreamForm.findClusterCheckbox('all').should('be.disabled');
215+
// logsStreamForm
216+
// .findClusterCheckbox('cluster-1')
217+
// .should('be.disabled')
218+
// .should('be.checked');
219+
// logsStreamForm
220+
// .findClusterCheckbox('cluster-3')
221+
// .should('be.disabled')
222+
// .should('be.checked');
223+
224+
// Use "Toggle all clusters" to select all eligible clusters
225+
logsStreamForm.findClusterCheckbox('all').check();
223226

224227
// Edit Stream button should be enabled
225228
ui.button.findByTitle('Edit Stream').should('be.enabled');
@@ -251,7 +254,7 @@ describe('Edit Stream', () => {
251254
status: 'active',
252255
destinations: [mockDestination.id],
253256
details: {
254-
is_auto_add_all_clusters_enabled: true,
257+
cluster_ids: [1, 3], // TODO: change to is_auto_add_all_clusters_enabled: true when "Automatically include all existing and recently configured clusters" feature is available
255258
},
256259
},
257260
mockLKEAuditLogsStream
@@ -266,7 +269,7 @@ describe('Edit Stream', () => {
266269
status: 'active',
267270
destinations: [mockDestination.id],
268271
details: {
269-
is_auto_add_all_clusters_enabled: true,
272+
cluster_ids: [1, 3], // TODO: change to is_auto_add_all_clusters_enabled: true when "Automatically include all existing and recently configured clusters" feature is available
270273
},
271274
});
272275
});

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

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ import type {
1010
Stream,
1111
} from '@linode/api-v4';
1212

13-
1413
export const mockDestinationPayload: CreateDestinationPayload = {
1514
label: randomLabel(),
1615
type: destinationType.AkamaiObjectStorage,
@@ -23,17 +22,16 @@ export const mockDestinationPayload: CreateDestinationPayload = {
2322
},
2423
};
2524

26-
export const mockDestinationPayloadWithId = {
27-
id: mockDestination.id,
28-
...mockDestinationPayload,
29-
};
30-
3125
export const mockDestination: Destination = destinationFactory.build({
3226
id: 1290,
3327
...mockDestinationPayload,
3428
version: '1.0',
3529
});
3630

31+
export const mockDestinationPayloadWithId = {
32+
id: mockDestination.id,
33+
...mockDestinationPayload,
34+
};
3735

3836
export const mockAuditLogsStreamPayload: CreateStreamPayload = {
3937
label: randomLabel(),

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

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,10 @@ import { randomLabel } from 'support/util/random';
99

1010
import { getStreamTypeOption } from 'src/features/Delivery/deliveryUtils';
1111

12-
import type { AkamaiObjectStorageDetails, StreamType } from '@linode/api-v4';
12+
import type {
13+
AkamaiObjectStorageDetailsExtended,
14+
StreamType,
15+
} from '@linode/api-v4';
1316

1417
export const logsStreamForm = {
1518
/**
@@ -84,7 +87,7 @@ export const logsStreamForm = {
8487
*/
8588
fillOutNewAkamaiObjectStorageDestination: (
8689
label = randomLabel(),
87-
details: AkamaiObjectStorageDetails = mockDestinationPayload.details as AkamaiObjectStorageDetails
90+
details: AkamaiObjectStorageDetailsExtended = mockDestinationPayload.details as AkamaiObjectStorageDetailsExtended
8891
) => {
8992
// Create new destination label
9093
cy.findByLabelText('Destination Name')

0 commit comments

Comments
 (0)