Skip to content

Commit

Permalink
sort correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
lmiller1990 committed May 23, 2022
1 parent 0e32352 commit ff425a6
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
8 changes: 8 additions & 0 deletions packages/launchpad/src/setup/EnvironmentSetup.cy.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,14 @@ describe('<EnvironmentSetup />', { viewportWidth: 800 }, () => {
.click()
.should('have.attr', 'aria-expanded', 'true')

cy.get('li')
.then(($items) => {
return $items.map((_idx, html) => Cypress.$(html).text()).get()
})
// alphabetical order
// we should "support is in alpha" for a11y (not shown visually)
.should('deep.eq', ['Create React App (v5) Support is in Alpha', 'Vue.js (v3)'])

const frameworkIconName = (frameworkName: string) => {
if (frameworkName.includes('React')) {
return 'react-logo'
Expand Down
11 changes: 2 additions & 9 deletions packages/launchpad/src/setup/EnvironmentSetup.vue
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ import {
} from '../generated/graphql'
import { useI18n } from '@cy/i18n'
import { sortBy } from 'lodash'
import { useMutation } from '@urql/vue'
gql`
Expand Down Expand Up @@ -93,18 +92,12 @@ const { t } = useI18n()
const bundlers = computed(() => {
const all = props.gql.framework?.supportedBundlers || []
const _bundlers = all.map((b) => {
return {
disabled: all.length <= 1,
...b,
}
})
return _bundlers
return all.map((b) => ({ disabled: all.length <= 1, ...b })).sort((x, y) => x.name.localeCompare(y.name))
})
const frameworks = computed(() => {
return sortBy((props.gql.frameworks ?? []).map((f) => ({ ...f })), 'category')
return (props.gql.frameworks || []).map((x) => ({ ...x })).sort((x, y) => x.name.localeCompare(y.name))
})
gql`
Expand Down

0 comments on commit ff425a6

Please sign in to comment.