Skip to content

Commit 24052eb

Browse files
authored
test: Addressing launchpad test flake in Windows (#22536)
* test: Bumping timeout on breadcrumb state checks for Windows * todos project was missing component index but has component testing configured * Adding key to links to ensure attrs are cleaned up/reset * Coercing boolean keys to strings to match vue key types
1 parent fac83fd commit 24052eb

File tree

3 files changed

+18
-1
lines changed

3 files changed

+18
-1
lines changed

packages/frontend-shared/src/gql-components/HeaderBarContent.vue

+4
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,9 @@
2626
<li class="inline-block">
2727
<!-- context for use of aria role and disabled here: https://www.scottohara.me/blog/2021/05/28/disabled-links.html -->
2828
<!-- the `href` given here is a fake one provided for the sake of assistive technology. no actual routing is happening. -->
29+
<!-- the `key` is used to ensure the role/href attrs are added and removed appropriately from the element. -->
2930
<a
31+
:key="Boolean(hasLinkToProjects).toString()"
3032
class="font-medium"
3133
:class="hasLinkToProjects ? 'text-indigo-500 hocus-link-default' :
3234
'text-gray-700'"
@@ -51,7 +53,9 @@
5153
<li class="inline-block">
5254
<!-- context for use of aria role and disabled here: https://www.scottohara.me/blog/2021/05/28/disabled-links.html -->
5355
<!-- the `href` given here is a fake one provided for the sake of assistive technology. no actual routing is happening. -->
56+
<!-- the `key` is used to ensure the role/href attrs are added and removed appropriately from the element. -->
5457
<a
58+
:key="Boolean(hasLinkToCurrentProject).toString()"
5559
class="font-medium"
5660
:role="hasLinkToCurrentProject ? undefined : 'link'"
5761
:href="hasLinkToCurrentProject ? 'choose-testing-type' : undefined"

packages/launchpad/cypress/e2e/global-mode.cy.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,8 @@ describe('Launchpad: Global Mode', () => {
152152

153153
it('updates breadcrumb when selecting a project and navigating back', () => {
154154
const getBreadcrumbLink = (name: string, options: { disabled: boolean } = { disabled: false }) => {
155-
return cy.findByRole('link', { name }).should('have.attr', 'aria-disabled', options.disabled ? 'true' : 'false')
155+
// The timeout is increased to account for variability in configuration load times in CI.
156+
return cy.findByRole('link', { name, timeout: 10000 }).should('have.attr', 'aria-disabled', options.disabled ? 'true' : 'false')
156157
}
157158

158159
const resetSpies = () => {
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<meta charset="utf-8">
5+
<meta http-equiv="X-UA-Compatible" content="IE=edge">
6+
<meta name="viewport" content="width=device-width,initial-scale=1.0">
7+
<title>Components App</title>
8+
</head>
9+
<body>
10+
<div data-cy-root></div>
11+
</body>
12+
</html>

0 commit comments

Comments
 (0)