-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch '10.0-release' into tgriesser/chore/e2e-data-clean
* 10.0-release: feat: use fuzzy search (#18966) fix: onUnmounted warning in topnav (#18988) fix: CYPRESS_INTERNAL_VITE_DEV for development feat: Create default config file (#18943) feat(app): support editor preference (#18932)
- Loading branch information
Showing
83 changed files
with
1,265 additions
and
858 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
42 changes: 34 additions & 8 deletions
42
packages/app/src/settings/device/ExternalEditorSettings.spec.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,60 @@ | ||
import ExternalEditorSettings from './ExternalEditorSettings.vue' | ||
import { defaultMessages } from '@cy/i18n' | ||
import { ExternalEditorSettingsFragmentDoc } from '../../generated/graphql-test' | ||
|
||
const editorText = defaultMessages.settingsPage.editor | ||
|
||
describe('<ExternalEditorSettings />', () => { | ||
beforeEach(() => { | ||
cy.mount(() => <ExternalEditorSettings class="p-12" />) | ||
}) | ||
|
||
it('renders the placeholder by default', () => { | ||
cy.mountFragment(ExternalEditorSettingsFragmentDoc, { | ||
render: (gqlVal) => { | ||
return <ExternalEditorSettings gql={gqlVal} /> | ||
}, | ||
}) | ||
|
||
cy.findByText(editorText.noEditorSelectedPlaceholder).should('be.visible') | ||
}) | ||
|
||
it('renders the title and description', () => { | ||
cy.mountFragment(ExternalEditorSettingsFragmentDoc, { | ||
render: (gqlVal) => { | ||
return <ExternalEditorSettings gql={gqlVal} /> | ||
}, | ||
}) | ||
|
||
cy.findByText(editorText.description).should('be.visible') | ||
cy.findByText(editorText.title).should('be.visible') | ||
}) | ||
|
||
it('can select an editor', () => { | ||
cy.mountFragment(ExternalEditorSettingsFragmentDoc, { | ||
render: (gqlVal) => { | ||
return <ExternalEditorSettings gql={gqlVal} /> | ||
}, | ||
}) | ||
|
||
const optionsSelector = '[role=option]' | ||
const inputSelector = '[aria-haspopup=true]' | ||
|
||
cy.get(inputSelector).click() | ||
.get(optionsSelector).should('be.visible') | ||
.get(optionsSelector).then(($options) => { | ||
const text = $options.first().text() | ||
|
||
cy.wrap($options.first()).click() | ||
.get(optionsSelector).should('not.exist') | ||
.get(inputSelector).should('have.text', text) | ||
}) | ||
}) | ||
|
||
it('can input a custom binary', () => { | ||
cy.mountFragment(ExternalEditorSettingsFragmentDoc, { | ||
render: (gqlVal) => { | ||
return <ExternalEditorSettings gql={gqlVal} /> | ||
}, | ||
}) | ||
|
||
cy.findByPlaceholderText('Custom path...').type('/usr/bin') | ||
cy.get('[data-cy="use-custom-editor"]').as('custom') | ||
cy.get('@custom').click() | ||
|
||
cy.get('@custom').should('be.focused') | ||
cy.get('[data-cy="use-well-known-editor"]').should('not.be.focused') | ||
}) | ||
}) |
Oops, something went wrong.