mirror of
https://github.com/cypress-io/cypress.git
synced 2026-02-10 17:20:11 -06:00
fix: Address test failures caused by use of projectId
This commit is contained in:
@@ -370,7 +370,11 @@ describe('<HeaderBarContent />', { viewportWidth: 1000, viewportHeight: 750 }, (
|
||||
...(options?.state ?? {}),
|
||||
}
|
||||
|
||||
result.currentProject.projectId = options?.projectId ?? null
|
||||
const projectId = result.currentProject.config.find((item: {field: string, value: string}) => item.field = 'projectId')
|
||||
|
||||
if (projectId) {
|
||||
projectId.value = options?.projectId
|
||||
}
|
||||
},
|
||||
render: (gqlVal) => <div class="border-current border-1 h-700px resize overflow-auto"><HeaderBarContent gql={gqlVal} show-browsers={true} allowAutomaticPromptOpen={true} /></div>,
|
||||
})
|
||||
|
||||
@@ -157,7 +157,7 @@
|
||||
v-model="isLoginOpen"
|
||||
:gql="props.gql"
|
||||
utm-medium="Nav"
|
||||
:show-connect-button-after-login="isApp && !props.gql?.currentProject?.projectId"
|
||||
:show-connect-button-after-login="isApp && !cloudProjectId"
|
||||
@connect-project="handleConnectProject"
|
||||
/>
|
||||
</div>
|
||||
@@ -234,7 +234,6 @@ fragment HeaderBar_HeaderBarContent on Query {
|
||||
savedState
|
||||
currentTestingType
|
||||
branch
|
||||
projectId
|
||||
}
|
||||
isGlobalMode
|
||||
...TopNav
|
||||
@@ -251,6 +250,10 @@ const savedState = computed(() => {
|
||||
return props.gql?.currentProject?.savedState
|
||||
})
|
||||
|
||||
const cloudProjectId = computed(() => {
|
||||
return props.gql?.currentProject?.config?.find((item: { field: string }) => item.field === 'projectId')?.value
|
||||
})
|
||||
|
||||
const currentProject = computed(() => props.gql.currentProject)
|
||||
|
||||
const isLoginOpen = ref(false)
|
||||
@@ -336,7 +339,7 @@ function shouldShowPrompt (prompt: { slug: string, noProjectId: boolean, interva
|
||||
|
||||
// if prompt requires no project id,
|
||||
// check if project id exists
|
||||
if (prompt.noProjectId && props.gql?.currentProject?.projectId) {
|
||||
if (prompt.noProjectId && cloudProjectId.value) {
|
||||
return false
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user