Skip to content

Commit

Permalink
Merge branch 'develop' into 22754-add-login-state-to-manifest-request
Browse files Browse the repository at this point in the history
  • Loading branch information
mike-plummer authored Jul 19, 2022
2 parents 9647dca + 1da95a7 commit dfb7416
Show file tree
Hide file tree
Showing 17 changed files with 166 additions and 79 deletions.
17 changes: 7 additions & 10 deletions circle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ mainBuildFilters: &mainBuildFilters
branches:
only:
- develop
- issue-22147-nohoist
- global-mode-issue

# usually we don't build Mac app - it takes a long time
# but sometimes we want to really confirm we are doing the right thing
Expand All @@ -36,8 +36,7 @@ macWorkflowFilters: &darwin-workflow-filters
when:
or:
- equal: [ develop, << pipeline.git.branch >> ]
- equal: [ linux-arm64, << pipeline.git.branch >> ]
- equal: [ 'tbiethman/UNIFY-1816-prototype', << pipeline.git.branch >> ]
- equal: [ 'global-mode-issue', << pipeline.git.branch >> ]
- matches:
pattern: "-release$"
value: << pipeline.git.branch >>
Expand All @@ -46,7 +45,6 @@ linuxArm64WorkflowFilters: &linux-arm64-workflow-filters
when:
or:
- equal: [ develop, << pipeline.git.branch >> ]
- equal: [ linux-arm64, << pipeline.git.branch >> ]
- matches:
pattern: "-release$"
value: << pipeline.git.branch >>
Expand All @@ -65,7 +63,6 @@ windowsWorkflowFilters: &windows-workflow-filters
when:
or:
- equal: [ develop, << pipeline.git.branch >> ]
- equal: [ linux-arm64, << pipeline.git.branch >> ]
- matches:
pattern: "-release$"
value: << pipeline.git.branch >>
Expand Down Expand Up @@ -129,7 +126,7 @@ commands:
- run:
name: Check current branch to persist artifacts
command: |
if [[ "$CIRCLE_BRANCH" != "develop" && "$CIRCLE_BRANCH" != "tbiethman/UNIFY-1816-prototype" ]]; then
if [[ "$CIRCLE_BRANCH" != "develop" && "$CIRCLE_BRANCH" != "global-mode-issue" ]]; then
echo "Not uploading artifacts or posting install comment for this branch."
circleci-agent step halt
fi
Expand Down Expand Up @@ -658,7 +655,7 @@ commands:
## by default, assert that at least 1 test ran
default: 0
steps:
- run:
- run:
name: 'Verify Mocha Results'
command: |
source ./scripts/ensure-node.sh
Expand Down Expand Up @@ -1614,7 +1611,7 @@ jobs:
path: /tmp/cypress
- store_artifacts:
path: /tmp/artifacts
- store-npm-logs
- store-npm-logs

run-vite-dev-server-integration-tests:
<<: *defaults
Expand All @@ -1636,7 +1633,7 @@ jobs:
path: /tmp/cypress
- store_artifacts:
path: /tmp/artifacts
- store-npm-logs
- store-npm-logs

ui-components-integration-tests:
<<: *defaults
Expand Down Expand Up @@ -2363,7 +2360,7 @@ linux-x64-workflow: &linux-x64-workflow
- run-vite-dev-server-integration-tests:
context: [test-runner:cypress-record-key, test-runner:percy]
requires:
- system-tests-node-modules-install
- system-tests-node-modules-install
- run-app-component-tests-chrome:
context: [test-runner:cypress-record-key, test-runner:launchpad-tests, test-runner:percy]
percy: true
Expand Down
6 changes: 6 additions & 0 deletions cli/lib/exec/open.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,12 @@ const { exitWithError } = require('../errors')
* @returns {string[]} list of CLI arguments
*/
const processOpenOptions = (options = {}) => {
// In addition to setting the project directory, setting the project option
// here ultimately decides whether cypress is run in global mode or not.
// It's first based off whether it's installed globally by npm/yarn (-g).
// A global install can be overridden by the --project flag, putting Cypress
// in project mode. A non-global install can be overridden by the --global
// flag, putting it in global mode.
if (!util.isInstalledGlobally() && !options.global && !options.project) {
options.project = process.cwd()
}
Expand Down
6 changes: 3 additions & 3 deletions packages/app/cypress/e2e/specs.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ describe('App: Specs', () => {
}).should('be.visible').within(() => {
cy.validateExternalLink({ name: 'Need help', href: 'https://on.cypress.io/test-type-options' })
cy.findByRole('button', { name: 'Close' }).should('be.visible').as('CloseDialogButton')
cy.get('[data-cy="file-match-indicator"]').contains('0 Matches')
cy.get('[data-cy="file-match-indicator"]').contains('No Matches')
cy.get('[data-cy="spec-pattern"]').contains('cypress/e2e/**/*.cy.{js,jsx,ts,tsx}')
})

Expand Down Expand Up @@ -320,7 +320,7 @@ describe('App: Specs', () => {
.should('be.visible')
.and('contain', defaultMessages.createSpec.page.customPatternNoSpecs.description.split('{0}')[0])

cy.findByTestId('file-match-indicator').should('contain', '0 Matches')
cy.findByTestId('file-match-indicator').should('contain', 'No Matches')
cy.findByRole('button', { name: 'cypress.config.js' })
cy.findByTestId('spec-pattern').should('contain', 'src/**/*.{cy,spec}.{js,jsx}')

Expand Down Expand Up @@ -652,7 +652,7 @@ describe('App: Specs', () => {
.should('be.visible')
.and('contain', defaultMessages.createSpec.page.customPatternNoSpecs.description.split('{0}')[0])

cy.findByTestId('file-match-indicator').should('contain', '0 Matches')
cy.findByTestId('file-match-indicator').should('contain', 'No Matches')
cy.findByRole('button', { name: 'cypress.config.js' })
cy.findByTestId('spec-pattern').should('contain', 'src/specs-folder/*.cy.{js,jsx}')

Expand Down
34 changes: 33 additions & 1 deletion packages/app/src/components/SpecPatterns.cy.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ describe('<SpecPatterns />', () => {
cy.get('[data-cy="file-match-indicator"]').contains('50 Matches')
})

it('renders component spec pattern should not show matches', () => {
it('renders component spec pattern should not show matches verbiage', () => {
cy.mountFragment(SpecPatternsFragmentDoc, {
onResult: (res) => {
if (!res) {
Expand All @@ -46,4 +46,36 @@ describe('<SpecPatterns />', () => {
cy.get('[data-cy="spec-pattern"]').contains('**/*.cy.{js,jsx,ts,tsx}')
cy.get('[data-cy="file-match-indicator"]').should('contain', 'specPattern')
})

it('displays `No Matches` when specs are empty', () => {
cy.mountFragment(SpecPatternsFragmentDoc, {
onResult: (res) => {
if (!res) {
return
}

res.currentTestingType = 'component'
res.specs = []
},
render: (gql) => <div class="p-16px"><SpecPatterns gql={gql}/></div>,
})

cy.get('[data-cy="file-match-indicator"]').contains('No Matches')
})

it('displays `1 Match` when specs has 1 element', () => {
cy.mountFragment(SpecPatternsFragmentDoc, {
onResult: (res) => {
if (!res) {
return
}

res.currentTestingType = 'component'
res.specs = res.specs.slice(0, 1) || []
},
render: (gql) => <div class="p-16px"><SpecPatterns gql={gql}/></div>,
})

cy.get('[data-cy="file-match-indicator"]').contains('1 Match')
})
})
10 changes: 3 additions & 7 deletions packages/app/src/components/SpecPatterns.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,7 @@
<div class="flex p-16px items-center justify-between">
<FileMatchIndicator :variant="props.variant">
<span v-if="props.variant === 'info'">specPattern</span>
<i18n-t
v-else
scope="global"
keypath="components.specPattern.matches"
>
{{ props.gql.specs.length }}
</i18n-t>
<span v-else>{{ t('components.specPattern.matches', props.gql.specs.length) }}</span>
</FileMatchIndicator>
<OpenConfigFileInIDE
v-slot="{onClick}"
Expand Down Expand Up @@ -41,6 +35,7 @@
<script lang="ts" setup>
import { computed } from 'vue'
import { gql } from '@urql/core'
import { useI18n } from 'vue-i18n'
import type { SpecPatternsFragment } from '../generated/graphql'
import OpenConfigFileInIDE from '@packages/frontend-shared/src/gql-components/OpenConfigFileInIDE.vue'
import FileMatchIndicator from './FileMatchIndicator.vue'
Expand All @@ -58,6 +53,7 @@ fragment SpecPatterns on CurrentProject {
}
`
const { t } = useI18n()
const props = defineProps<{
gql: SpecPatternsFragment
variant?: 'default' | 'info'
Expand Down
Loading

0 comments on commit dfb7416

Please sign in to comment.