Skip to content

Commit 8ef367e

Browse files
upcoming: [DI-28003] - New contextual view - selectable dashboards filter in case of multiple dashboards (#13073)
* upcoming: [DI-28003] - Selectable dashboards filter in contextual view * upcoming: [DI-28003] - Remove unused prop * upcoming: [DI-28003] - Put length check as list is empty * upcoming: [DI-28003] - Add backward compatability * upcoming: [DI-28003] - Remove service file changes * upcoming: [DI-28003] - Remove unwanted handler * upcoming: [DI-28003] - Minor update * upcoming: [DI-28003] - Cleanup * upcoming: [DI-28003] - Update cypress test cases * upcoming: [DI-28003] - Update error msg * upcoming: [DI-28003] - Add temporary integration in firewalls page for review/demo * upcoming: [DI-28003] - Add changeset * upcoming: [DI-28003] - Remove temporary integration in firewalls page
1 parent 9868d7c commit 8ef367e

File tree

8 files changed

+200
-210
lines changed

8 files changed

+200
-210
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@linode/manager": Upcoming Features
3+
---
4+
5+
CloudPulse-Metrics: Enhance `CloudPulseDashboardWithFilters.tsx` and `CloudPulseDashboardSelect.tsx` to handle switching between dashboards in contextual view ([#13073](https://github.com/linode/manager/pull/13073))

packages/manager/cypress/e2e/core/cloudpulse/aclp-support.spec.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -101,9 +101,7 @@ describe('ACLP Components UI varies according to ACLP support by region and user
101101
.should('be.visible')
102102
.should('be.enabled');
103103
// UI displays mock error msg
104-
cy.contains(
105-
`Error while loading Dashboard with Id - ${this.mockDashboardId}`
106-
);
104+
cy.contains('Error loading dashboards');
107105
});
108106
});
109107

packages/manager/cypress/e2e/core/cloudpulse/metrics-service-ld-flags.spec.ts

Lines changed: 20 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ describe('Linode ACLP Metrics and Alerts Flag Behavior', () => {
160160
.click();
161161
});
162162

163-
it('should display "Linode" with a beta tag in the Service dropdown on the Metrics page when metrics.beta is true and enabled is false', () => {
163+
it('should not display "Linode" with a beta tag in the Service dropdown on the Metrics page when metrics.beta is true and enabled is false', () => {
164164
// Mock the feature flags to disable metrics for Linode
165165

166166
const mockflags = flagsFactory.build({
@@ -179,21 +179,12 @@ describe('Linode ACLP Metrics and Alerts Flag Behavior', () => {
179179

180180
cy.visitWithLogin('/metrics');
181181

182-
ui.autocomplete.findByLabel('Dashboard').click();
182+
// Verify the autocomplete is disabled and shows the placeholder text
183183

184-
// Verify the autocomplete dropdown is visible and contains the "no options" message
185-
186-
cy.get('[data-qa-autocomplete-popper]')
184+
cy.findByPlaceholderText('Select a Dashboard')
187185
.should('be.visible')
188-
.and('contain.text', 'You have no options to choose from')
189-
.within(() => {
190-
// Assert that "Linode" does not appear in the dropdown
191-
192-
cy.contains('Linode').should('not.exist');
193-
// Assert that the beta chip is not rendered
194-
195-
cy.get('[data-testid="betaChip"]').should('not.exist');
196-
});
186+
.and('be.disabled')
187+
.and('have.value', '');
197188
});
198189
// SKIPPED: The feature flag normalizer auto-enables Linode when `{ aclpServices: { linode: {} } }` is provided,
199190
// expanding to `aclpServices.linode.metrics = { beta: true, enabled: true }`. Expected: Linode hidden when the
@@ -215,16 +206,10 @@ describe('Linode ACLP Metrics and Alerts Flag Behavior', () => {
215206
cy.get('@dashboardInput').click();
216207

217208
// Verify the dropdown is visible and shows "no options"
218-
cy.get('[data-qa-autocomplete-popper]')
209+
cy.findByPlaceholderText('Select a Dashboard')
219210
.should('be.visible')
220-
.and('contain.text', 'You have no options to choose from')
221-
.within(() => {
222-
// Assert "Linode" is not shown
223-
cy.contains('Linode').should('not.exist');
224-
225-
// Assert no beta chip is visible
226-
cy.get('[data-testid="betaChip"]').should('not.exist');
227-
});
211+
.and('be.disabled')
212+
.and('have.value', '');
228213
});
229214

230215
it('should not display "Linode" with a beta tag in the Service dropdown on the Metrics page when metrics.beta is false and the service is not enabled', () => {
@@ -242,21 +227,12 @@ describe('Linode ACLP Metrics and Alerts Flag Behavior', () => {
242227

243228
cy.visitWithLogin('/metrics');
244229

245-
ui.autocomplete.findByLabel('Dashboard').click();
246-
247-
// Verify the autocomplete dropdown is visible and contains the "no options" message
230+
// Verify the autocomplete is disabled and shows the placeholder text
248231

249-
cy.get('[data-qa-autocomplete-popper]')
232+
cy.findByPlaceholderText('Select a Dashboard')
250233
.should('be.visible')
251-
.and('contain.text', 'You have no options to choose from')
252-
.within(() => {
253-
// Assert that "Linode" does not appear in the dropdown
254-
255-
cy.contains('Linode').should('not.exist');
256-
// Assert that the beta chip is not rendered
257-
258-
cy.get('[data-testid="betaChip"]').should('not.exist');
259-
});
234+
.and('be.disabled')
235+
.and('have.value', '');
260236
});
261237
// SKIPPED: If `aclpServices` is not passed, LaunchDarkly should treat it as null/false.
262238
// Currently, missing/partial flags are defaulted to `{ beta: true, enabled: true }`,
@@ -274,17 +250,11 @@ describe('Linode ACLP Metrics and Alerts Flag Behavior', () => {
274250
ui.autocomplete.findByLabel('Dashboard').as('dashboardInput');
275251
cy.get('@dashboardInput').click();
276252

277-
// Verify the dropdown is visible and shows "no options"
278-
cy.get('[data-qa-autocomplete-popper]')
253+
// Verify the dropdown is disabled and shows the placeholder text
254+
cy.findByPlaceholderText('Select a Dashboard')
279255
.should('be.visible')
280-
.and('contain.text', 'You have no options to choose from')
281-
.within(() => {
282-
// Assert "Linode" is not shown
283-
cy.contains('Linode').should('not.exist');
284-
285-
// Assert no beta chip is visible
286-
cy.get('[data-testid="betaChip"]').should('not.exist');
287-
});
256+
.and('be.disabled')
257+
.and('have.value', '');
288258
});
289259

290260
it('should not show Linode in Dashboard dropdown when metrics flags are missing and service is not enabled', () => {
@@ -306,20 +276,10 @@ describe('Linode ACLP Metrics and Alerts Flag Behavior', () => {
306276

307277
cy.visitWithLogin('/metrics');
308278

309-
ui.autocomplete.findByLabel('Dashboard').click();
310-
311-
// Verify the autocomplete dropdown is visible and contains the "no options" message
312-
313-
cy.get('[data-qa-autocomplete-popper]')
279+
// Verify the autocomplete is disabled and shows the placeholder text
280+
cy.findByPlaceholderText('Select a Dashboard')
314281
.should('be.visible')
315-
.and('contain.text', 'You have no options to choose from')
316-
.within(() => {
317-
// Assert that "Linode" does not appear in the dropdown
318-
319-
cy.contains('Linode').should('not.exist');
320-
// Assert that the beta chip is not rendered
321-
322-
cy.get('[data-testid="betaChip"]').should('not.exist');
323-
});
282+
.and('be.disabled')
283+
.and('have.value', '');
324284
});
325285
});

0 commit comments

Comments
 (0)