@@ -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