Skip to content

Commit a63d148

Browse files
test [M3-10517]: Fix flaky "timerange-verification.spec.ts" test (#12967)
* simplify time range by removing timezone conversion * cleanup tz * avoid race condition by re-fetching the component * Added changeset: Fix flakey timerange test
1 parent 7ddaa00 commit a63d148

File tree

2 files changed

+13
-9
lines changed

2 files changed

+13
-9
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@linode/manager": Tests
3+
---
4+
5+
Fix flakey timerange test ([#12967](https://github.com/linode/manager/pull/12967))

packages/manager/cypress/e2e/core/cloudpulse/timerange-verification.spec.ts

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -95,20 +95,16 @@ const databaseMock: Database = databaseFactory.build({
9595
type: engine,
9696
});
9797
const mockProfile = profileFactory.build({
98-
timezone: 'UTC',
98+
timezone: 'GMT',
9999
});
100100
/**
101-
* Generates a date in Indian Standard Time (IST) based on a specified number of days offset,
102-
* hour, and minute. The function also provides individual date components such as day, hour,
101+
* Generates a date in UTC based on a specified number of hours and minutes offset. The function also provides individual date components such as day, hour,
103102
* minute, month, and AM/PM.
104-
*
105-
* @param {number} daysOffset - The number of days to adjust from the current date. Positive
106-
* values give a future date, negative values give a past date.
107103
* @param {number} hour - The hour to set for the resulting date (0-23).
108104
* @param {number} [minute=0] - The minute to set for the resulting date (0-59). Defaults to 0.
109105
*
110106
* @returns {Object} - Returns an object containing:
111-
* - `actualDate`: The formatted date and time in IST (YYYY-MM-DD HH:mm).
107+
* - `actualDate`: The formatted date and time in UTC (YYYY-MM-DD HH:mm).
112108
* - `day`: The day of the month as a number.
113109
* - `hour`: The hour in the 24-hour format as a number.
114110
* - `minute`: The minute of the hour as a number.
@@ -324,8 +320,11 @@ describe('Integration tests for verifying Cloudpulse custom and preset configura
324320
cy.get('@endMeridiemSelect').find('[aria-label="PM"]').click();
325321

326322
// --- Set timezone ---
327-
cy.findByPlaceholderText('Choose a Timezone').as('timezoneInput').clear();
328-
cy.get('@timezoneInput').type('(GMT +0:00) Greenwich Mean Time{enter}');
323+
cy.findByPlaceholderText('Choose a Timezone').as('timezoneInput').click();
324+
cy.get('@timezoneInput').clear();
325+
cy.get('@timezoneInput')
326+
.should('not.be.disabled')
327+
.type('(GMT +0:00) Greenwich Mean Time{enter}');
329328

330329
// --- Apply date/time range ---
331330
cy.get('[data-qa-buttons="apply"]')

0 commit comments

Comments
 (0)