Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: update newProject ref when switching between organizations in SelectCloudProjectModal #25730

Merged
merged 6 commits into from
Feb 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions cli/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@

_Released 02/14/2023 (PENDING)_

**Bugfixes:**

- Fixed an issue with the Cloud project selection modal not showing the correct prompts. Fixes [#25520](https://github.com/cypress-io/cypress/issues/25520).

**Features:**

- Added the "Open in IDE" feature for failed tests reported from the Debug page. Addressed in [#25691](https://github.com/cypress-io/cypress/pull/25691).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,20 @@ describe('<SelectCloudProjectModal />', () => {
mountDialog()
})

it('can switch between organizations with and without projects', () => {
cy.get('[data-cy="selectOrganization"]').click()
cy.findByRole('listbox').within(() => cy.findAllByText('Test Org 2').click())

cy.contains('button', defaultMessages.runs.connect.modal.selectProject.connectProject).should('not.exist')
cy.contains('button', defaultMessages.runs.connect.modal.selectProject.createProject).should('be.visible')

cy.get('[data-cy="selectOrganization"]').click()
cy.findByRole('listbox').within(() => cy.findAllByText('Test Org 1').click())

cy.contains('button', defaultMessages.runs.connect.modal.selectProject.createProject).should('not.exist')
cy.contains('button', defaultMessages.runs.connect.modal.selectProject.connectProject).should('be.visible')
})

context('create new project', () => {
beforeEach(() => {
cy.contains('a', defaultMessages.runs.connect.modal.selectProject.createNewProject).click()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -344,10 +344,12 @@ watch(projectOptions, (newVal, oldVal) => {
}

if (newVal.length === 1) {
pickedProject.value = projectOptions.value[0]
pickedProject.value = newVal[0]
} else {
pickedProject.value = projectOptions.value.find((p) => p.name === projectName.value)
pickedProject.value = newVal.find((p) => p.name === projectName.value)
}

newProject.value = newVal.length === 0
}, {
immediate: true,
})
Expand Down