Skip to content

Commit 437a08e

Browse files
chore: update need help link for auto provision project slug error modal (#34033)
Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent 04dd296 commit 437a08e

2 files changed

Lines changed: 40 additions & 0 deletions

File tree

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
// tslint:disable-next-line: no-implicit-dependencies - unsure how to handle these
2+
import { defaultMessages } from '@cy/i18n'
3+
import AutoProvisionProjectIdModal from './AutoProvisionProjectIdModal.vue'
4+
5+
describe('<AutoProvisionProjectIdModal />', () => {
6+
const projectId = 'my-project-slug'
7+
const configFilePath = '/path/to/cypress.config.ts'
8+
9+
function mountModal (onClose?: () => void) {
10+
cy.mount(() => (
11+
<div class="h-screen">
12+
<AutoProvisionProjectIdModal
13+
projectId={projectId}
14+
configFilePath={configFilePath}
15+
onClose={onClose}
16+
/>
17+
</div>
18+
))
19+
}
20+
21+
it('renders project ID and links to project ID docs', () => {
22+
mountModal()
23+
24+
cy.contains(defaultMessages.runs.connect.modal.autoProvision.title).should('be.visible')
25+
cy.contains(defaultMessages.runs.connect.modal.autoProvision.body).should('be.visible')
26+
cy.contains(`projectId: '${projectId}',`).should('be.visible')
27+
cy.get('[data-cy="external"]')
28+
.should('have.attr', 'href', 'https://on.cypress.io/what-is-a-project-id')
29+
})
30+
31+
it('emits close when the footer close button is clicked', () => {
32+
const onClose = cy.stub().as('closeStub')
33+
34+
mountModal(onClose)
35+
36+
cy.contains('button', defaultMessages.runs.connect.modal.autoProvision.close).click()
37+
cy.get('@closeStub').should('have.been.calledOnce')
38+
})
39+
})

packages/frontend-shared/src/gql-components/modals/AutoProvisionProjectIdModal.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
<StandardModal
33
model-value
44
:title="t('runs.connect.modal.autoProvision.title')"
5+
help-link="https://on.cypress.io/what-is-a-project-id"
56
@update:model-value="emit('close')"
67
>
78
<div class="w-[640px]">

0 commit comments

Comments
 (0)