Skip to content

Commit

Permalink
Cell generator: Fix formatting in template (#9301)
Browse files Browse the repository at this point in the history
  • Loading branch information
Tobbe authored and jtoar committed Nov 3, 2023
1 parent 9555fcd commit 359f4bc
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -510,6 +510,7 @@ describe('UserProfileCell', () => {
exports[`TypeScript: generates list cells if list flag passed in 1`] = `
"import type { FindBazingaQuery, FindBazingaQueryVariables } from 'types/graphql'
import type { CellSuccessProps, CellFailureProps } from '@redwoodjs/web'
export const QUERY = gql\`
Expand Down Expand Up @@ -633,6 +634,7 @@ export const standard = (/* vars, { ctx, req } */) => ({
exports[`TypeScript: generates list cells if name is plural 1`] = `
"import type { MembersQuery } from 'types/graphql'
import type { CellSuccessProps, CellFailureProps } from '@redwoodjs/web'
export const QUERY = gql\`
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import type { ${operationName}, ${operationName}Variables } from 'types/graphql'

import type { CellSuccessProps, CellFailureProps } from '@redwoodjs/web'

export const QUERY = gql`
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import type { ${operationName} } from 'types/graphql'

import type { CellSuccessProps, CellFailureProps } from '@redwoodjs/web'


Expand Down
6 changes: 3 additions & 3 deletions packages/internal/src/__tests__/ast.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ test('tests default exports', () => {
})

test('Returns the exported query from a cell (ignoring others)', () => {
const cellFileAst = fileToAst(getFixturePath('web/src/cell.ts'))
const cellFileAst = fileToAst(getFixturePath('web/src/cell.tsx'))

const cellQuery = getCellGqlQuery(cellFileAst)
expect(cellQuery).toMatchInlineSnapshot(`
Expand All @@ -93,8 +93,8 @@ test('Returns the exported query from a cell (ignoring others)', () => {
`)
})

test('Returns the all quries from a file using getGqlQueries', () => {
const cellFileAst = fileToAst(getFixturePath('web/src/cell.ts'))
test('Returns the all queries from a file using getGqlQueries', () => {
const cellFileAst = fileToAst(getFixturePath('web/src/cell.tsx'))

const cellQuery = getGqlQueries(cellFileAst)
expect(cellQuery).toMatchInlineSnapshot(`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
/* eslint-disable */

import type { BazingaQuery } from 'types/graphql'

import type { CellSuccessProps, CellFailureProps } from '@redwoodjs/web'

export const QUERY = gql`
Expand Down

0 comments on commit 359f4bc

Please sign in to comment.