Skip to content

Commit

Permalink
fix: appease prettier
Browse files Browse the repository at this point in the history
Signed-off-by: ryanwolhuter <dev@ryanwolhuter.com>
  • Loading branch information
ryanwolhuter committed Jan 22, 2024
1 parent bb2a7c2 commit af12402
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,18 @@ to: "<%= rootDir %>/<%= h.changeCase.param(documentType) %>/src/tests/<%= module
unless_exists: true
---
/**
* This is a scaffold file meant for customization:
* - change it by adding new tests or modifying the existing ones
*/
* This is a scaffold file meant for customization:
* - change it by adding new tests or modifying the existing ones
*/

import { generateMock } from '@powerhousedao/codegen';

import utils from '../../gen/utils';
import { z } from '../../gen/schema';
import { z } from '../../gen/schema';
import { reducer } from '../../gen/reducer';
import * as creators from '../../gen/<%= module %>/creators';
import { <%= h.changeCase.pascal(documentType) %>Document } from '../../gen/types';


describe('<%= h.changeCase.pascal(module) %> Operations', () => {
let document: <%= h.changeCase.pascal(documentType) %>Document;

Expand All @@ -26,13 +25,17 @@ describe('<%= h.changeCase.pascal(module) %> Operations', () => {
<% actions.forEach(action => { _%>
it('should handle <%= h.changeCase.camel(action.name) %> operation', () => {
const input = generateMock(z.<%= h.changeCase.pascal(action.name) %>InputSchema());
const updatedDocument = reducer(document, creators.<%= h.changeCase.camel(action.name) %>(input));
const updatedDocument = reducer(
document,
creators.<%= h.changeCase.camel(action.name) %>(input),
);

expect(updatedDocument.operations.<%= action.scope %>).toHaveLength(1);
expect(updatedDocument.operations.<%= action.scope %>[0].type).toBe('<%= h.changeCase.constant(action.name) %>');
expect(updatedDocument.operations.<%= action.scope %>[0].type).toBe(
'<%= h.changeCase.constant(action.name) %>',
);
expect(updatedDocument.operations.<%= action.scope %>[0].input).toStrictEqual(input);
expect(updatedDocument.operations.<%= action.scope %>[0].index).toEqual(0);
});

<% }); _%>
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ to: "<%= rootDir %>/<%= h.changeCase.param(documentType) %>/src/tests/document-m
unless_exists: true
---
/**
* This is a scaffold file meant for customization:
* - change it by adding new tests or modifying the existing ones
*/
* This is a scaffold file meant for customization:
* - change it by adding new tests or modifying the existing ones
*/

import utils, { initialGlobalState, initialLocalState } from '../../gen/utils';

Expand Down

0 comments on commit af12402

Please sign in to comment.