Skip to content

Commit

Permalink
fix(cli): Fix Cell test generation for list cells (#11779)
Browse files Browse the repository at this point in the history
  • Loading branch information
Tobbe authored Dec 14, 2024
1 parent 31e3074 commit aa0a44e
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ describe('BlogPostsCell', () => {

it('renders Failure successfully', async () => {
expect(() => {
render(<Failure id={42} error={new Error('Oh no')} />)
render(<Failure error={new Error('Oh no')} />)
}).not.toThrow()
})

Expand All @@ -36,7 +36,7 @@ describe('BlogPostsCell', () => {

it('renders Success successfully', async () => {
expect(() => {
render(<Success id={42} blogPosts={standard().blogPosts} />)
render(<Success blogPosts={standard().blogPosts} />)
}).not.toThrow()
})
})
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ describe('CustomIdFieldsCell', () => {
it('renders Failure successfully', async () => {
expect(() => {
render(<Failure uuid={'42'} error={new Error('Oh no')} />)
render(<Failure error={new Error('Oh no')} />)
}).not.toThrow()
})
Expand All @@ -178,7 +178,7 @@ describe('CustomIdFieldsCell', () => {
it('renders Success successfully', async () => {
expect(() => {
render(<Success uuid={'42'} customIdFields={standard().customIdFields} />)
render(<Success customIdFields={standard().customIdFields} />)
}).not.toThrow()
})
})
Expand Down Expand Up @@ -1232,7 +1232,7 @@ describe('AddressesCell', () => {
it('renders Failure successfully', async () => {
expect(() => {
render(<Failure id={'42'} error={new Error('Oh no')} />)
render(<Failure error={new Error('Oh no')} />)
}).not.toThrow()
})
Expand All @@ -1244,7 +1244,7 @@ describe('AddressesCell', () => {
it('renders Success successfully', async () => {
expect(() => {
render(<Success id={'42'} addresses={standard().addresses} />)
render(<Success addresses={standard().addresses} />)
}).not.toThrow()
})
})
Expand Down Expand Up @@ -1365,7 +1365,7 @@ describe('MembersCell', () => {
it('renders Failure successfully', async () => {
expect(() => {
render(<Failure id={42} error={new Error('Oh no')} />)
render(<Failure error={new Error('Oh no')} />)
}).not.toThrow()
})
Expand All @@ -1377,7 +1377,7 @@ describe('MembersCell', () => {
it('renders Success successfully', async () => {
expect(() => {
render(<Success id={42} members={standard().members} />)
render(<Success members={standard().members} />)
}).not.toThrow()
})
})
Expand Down
4 changes: 2 additions & 2 deletions packages/cli/src/commands/generate/cell/cell.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,8 @@ export const files = async ({ name, typescript, ...options }) => {
generator: 'cell',
templatePath: 'test.js.template',
templateVars: {
idName,
mockIdValues,
idName: shouldGenerateList ? undefined : idName,
mockIdValues: shouldGenerateList ? undefined : mockIdValues,
},
})

Expand Down

0 comments on commit aa0a44e

Please sign in to comment.