Skip to content

Commit e11b73b

Browse files
authored
Merge branch 'develop' into marktnoonan/percy-content-flake
2 parents 94de984 + c058bf2 commit e11b73b

File tree

3 files changed

+4
-98
lines changed

3 files changed

+4
-98
lines changed

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

+3-45
Original file line numberDiff line numberDiff line change
@@ -50,21 +50,9 @@
5050
<i-cy-chevron-right_x16 class="icon-dark-gray-200" />
5151
</li>
5252
<li class="inline-block">
53-
<!-- context for use of aria role and disabled here: https://www.scottohara.me/blog/2021/05/28/disabled-links.html -->
54-
<!-- the `href` given here is a fake one provided for the sake of assistive technology. no actual routing is happening. -->
55-
<!-- the `key` is used to ensure the role/href attrs are added and removed appropriately from the element. -->
56-
<a
57-
:key="canClearTestingType.toString()"
58-
class="font-medium"
59-
:role="canClearTestingType ? undefined : 'link'"
60-
:href="canClearTestingType ? 'choose-testing-type' : undefined"
61-
:class="canClearTestingType ? 'text-indigo-500 hocus-link-default' :
62-
'text-gray-700'"
63-
:ariaDisabled="!canClearTestingType"
64-
@click.prevent="clearTestingType"
65-
>
53+
<span class="font-medium">
6654
{{ currentProject.title }}
67-
</a>
55+
</span>
6856
<!-- currentProject might not have a branch -->
6957
<template v-if="currentProject.branch">
7058
<!-- Using a margin here causes different overflow problems.
@@ -179,7 +167,7 @@ import { gql, useMutation, useSubscription } from '@urql/vue'
179167
import { ref, computed } from 'vue'
180168
import type { HeaderBar_HeaderBarContentFragment } from '../generated/graphql'
181169
import {
182-
GlobalPageHeader_ClearCurrentProjectDocument, GlobalPageHeader_ClearCurrentTestingTypeDocument,
170+
GlobalPageHeader_ClearCurrentProjectDocument,
183171
HeaderBarContent_AuthChangeDocument,
184172
} from '../generated/graphql'
185173
import TopNav from './topnav/TopNav.vue'
@@ -235,24 +223,6 @@ mutation GlobalPageHeader_clearCurrentProject {
235223
}
236224
`
237225
238-
gql`
239-
mutation GlobalPageHeader_ClearCurrentTestingType {
240-
clearCurrentTestingType {
241-
baseError {
242-
id
243-
...BaseError
244-
}
245-
warnings {
246-
id
247-
}
248-
currentProject {
249-
id
250-
currentTestingType
251-
}
252-
}
253-
}
254-
`
255-
256226
gql`
257227
fragment HeaderBar_HeaderBarContent on Query {
258228
currentProject {
@@ -262,7 +232,6 @@ fragment HeaderBar_HeaderBarContent on Query {
262232
savedState
263233
currentTestingType
264234
branch
265-
isLoadingNodeEvents
266235
}
267236
isGlobalMode
268237
...TopNav
@@ -284,13 +253,8 @@ const cloudProjectId = computed(() => {
284253
285254
const currentProject = computed(() => props.gql.currentProject)
286255
287-
const canClearTestingType = computed(() => {
288-
return Boolean(props.gql?.currentProject?.currentTestingType && !props.gql?.currentProject?.isLoadingNodeEvents)
289-
})
290-
291256
const isLoginOpen = ref(false)
292257
const clearCurrentProjectMutation = useMutation(GlobalPageHeader_ClearCurrentProjectDocument)
293-
const clearCurrentTestingTypeMutation = useMutation(GlobalPageHeader_ClearCurrentTestingTypeDocument)
294258
295259
const openLogin = () => {
296260
isLoginOpen.value = true
@@ -302,12 +266,6 @@ const clearCurrentProject = () => {
302266
}
303267
}
304268
305-
const clearTestingType = () => {
306-
if (canClearTestingType.value) {
307-
clearCurrentTestingTypeMutation.executeMutation({})
308-
}
309-
}
310-
311269
const props = defineProps<{
312270
gql: HeaderBar_HeaderBarContentFragment
313271
showBrowsers?: boolean

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

+1-20
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ describe('Launchpad: Global Mode', () => {
169169
cy.get('[data-cy="dropzone"]').should('not.exist')
170170
})
171171

172-
it('updates breadcrumb when selecting a project and navigating back', () => {
172+
it('updates "Projects" link when a project is selected and allows navigating back', () => {
173173
const getBreadcrumbLink = (name: string, options: { disabled: boolean } = { disabled: false }) => {
174174
// The timeout is increased to account for variability in configuration load times in CI.
175175
return cy.findByRole('link', { name, timeout: 10000 }).should('have.attr', 'aria-disabled', options.disabled ? 'true' : 'false')
@@ -196,16 +196,6 @@ describe('Launchpad: Global Mode', () => {
196196
// Component testing breadcrumbs
197197
cy.get('[data-cy="project-card"]').contains('todos').click()
198198
cy.get('[data-cy-testingtype="component"]').click()
199-
cy.contains('li', 'component testing', { matchCase: false }).should('not.have.attr', 'href')
200-
resetSpies()
201-
getBreadcrumbLink('todos').click()
202-
getBreadcrumbLink('todos', { disabled: true })
203-
cy.withCtx((ctx) => {
204-
expect(ctx.lifecycleManager.setAndLoadCurrentTestingType).to.have.been.calledWith(null)
205-
})
206-
207-
cy.get('[data-cy-testingtype="component"]').click()
208-
cy.contains('li', 'component testing', { matchCase: false }).should('not.have.attr', 'href')
209199
resetSpies()
210200
getBreadcrumbLink('Projects').click()
211201
getBreadcrumbLink('Projects', { disabled: true })
@@ -216,15 +206,6 @@ describe('Launchpad: Global Mode', () => {
216206

217207
// E2E testing breadcrumbs
218208
cy.get('[data-cy="project-card"]').contains('todos').click()
219-
cy.get('[data-cy-testingtype="e2e"]').click()
220-
cy.contains('li', 'e2e testing', { matchCase: false }).should('not.have.attr', 'href')
221-
resetSpies()
222-
getBreadcrumbLink('todos').click()
223-
getBreadcrumbLink('todos', { disabled: true })
224-
cy.withCtx((ctx) => {
225-
expect(ctx.lifecycleManager.setAndLoadCurrentTestingType).to.have.been.calledWith(null)
226-
})
227-
228209
cy.get('[data-cy-testingtype="e2e"]').click()
229210
cy.contains('li', 'e2e testing', { matchCase: false }).should('not.have.attr', 'href')
230211
resetSpies()

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

-33
Original file line numberDiff line numberDiff line change
@@ -150,39 +150,6 @@ describe('Launchpad: Open Mode', () => {
150150
cy.contains('button', 'Docs').click()
151151
cy.contains(defaultMessages.topNav.docsMenu.gettingStartedTitle).should('be.visible')
152152
})
153-
154-
it('updates the breadcrumb when navigating forward and back', () => {
155-
const getBreadcrumbLink = (name: string, options: { disabled: boolean } = { disabled: false }) => {
156-
return cy.findByRole('link', { name }).should('have.attr', 'aria-disabled', options.disabled ? 'true' : 'false')
157-
}
158-
159-
cy.scaffoldProject('todos')
160-
cy.openProject('todos')
161-
cy.visitLaunchpad()
162-
163-
cy.contains('h1', 'Welcome to Cypress!')
164-
165-
getBreadcrumbLink('todos', { disabled: true })
166-
167-
cy.get('[data-cy-testingtype="e2e"]').click()
168-
169-
cy.contains('h1', 'Choose a Browser')
170-
171-
cy.contains('li', 'e2e testing', { matchCase: false }).should('not.have.attr', 'href')
172-
173-
cy.withCtx((ctx, { sinon }) => {
174-
sinon.spy(ctx.lifecycleManager, 'setAndLoadCurrentTestingType')
175-
})
176-
177-
getBreadcrumbLink('todos').click()
178-
179-
cy.contains('h1', 'Welcome to Cypress!')
180-
getBreadcrumbLink('todos', { disabled: true })
181-
182-
cy.withCtx((ctx) => {
183-
expect(ctx.lifecycleManager.setAndLoadCurrentTestingType).to.have.been.calledWith(null)
184-
})
185-
})
186153
})
187154

188155
describe('open in ide', () => {

0 commit comments

Comments
 (0)