@powerhousedao/codegen 0.0.9 → 0.0.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/codegen/.hygen/templates/powerhouse/generate-document-model/customUtils.esm.t +1 -1
- package/dist/codegen/.hygen/templates/powerhouse/generate-document-model/documentModelTest.esm.t +3 -3
- package/dist/codegen/.hygen/templates/powerhouse/generate-document-model/reducer.esm.t +1 -1
- package/dist/codegen/.hygen/templates/powerhouse/generate-document-model-module/customTest.esm.t +13 -10
- package/package.json +1 -1
package/dist/codegen/.hygen/templates/powerhouse/generate-document-model/documentModelTest.esm.t
CHANGED
|
@@ -3,9 +3,9 @@ to: "<%= rootDir %>/<%= h.changeCase.param(documentType) %>/src/tests/document-m
|
|
|
3
3
|
unless_exists: true
|
|
4
4
|
---
|
|
5
5
|
/**
|
|
6
|
-
* This is a scaffold file meant for customization:
|
|
7
|
-
* - change it by adding new tests or modifying the existing ones
|
|
8
|
-
*/
|
|
6
|
+
* This is a scaffold file meant for customization:
|
|
7
|
+
* - change it by adding new tests or modifying the existing ones
|
|
8
|
+
*/
|
|
9
9
|
|
|
10
10
|
import utils, { initialGlobalState, initialLocalState } from '../../gen/utils';
|
|
11
11
|
|
|
@@ -3,7 +3,7 @@ to: "<%= rootDir %>/<%= h.changeCase.param(documentType) %>/gen/reducer.ts"
|
|
|
3
3
|
force: true
|
|
4
4
|
---
|
|
5
5
|
import { ImmutableStateReducer, utils } from "document-model/document";
|
|
6
|
-
import { <%= h.changeCase.pascal(documentType) %>State, <%= h.changeCase.pascal(documentType) %>LocalState, z } from './
|
|
6
|
+
import { <%= h.changeCase.pascal(documentType) %>State, <%= h.changeCase.pascal(documentType) %>LocalState, z } from './types';
|
|
7
7
|
import { <%= h.changeCase.pascal(documentType) %>Action } from './actions';
|
|
8
8
|
|
|
9
9
|
<% modules.forEach(m => { _%>
|
package/dist/codegen/.hygen/templates/powerhouse/generate-document-model-module/customTest.esm.t
CHANGED
|
@@ -3,19 +3,18 @@ to: "<%= rootDir %>/<%= h.changeCase.param(documentType) %>/src/tests/<%= module
|
|
|
3
3
|
unless_exists: true
|
|
4
4
|
---
|
|
5
5
|
/**
|
|
6
|
-
* This is a scaffold file meant for customization:
|
|
7
|
-
* - change it by adding new tests or modifying the existing ones
|
|
8
|
-
*/
|
|
6
|
+
* This is a scaffold file meant for customization:
|
|
7
|
+
* - change it by adding new tests or modifying the existing ones
|
|
8
|
+
*/
|
|
9
9
|
|
|
10
|
-
import { generateMock } from '@
|
|
10
|
+
import { generateMock } from '@powerhousedao/codegen';
|
|
11
11
|
|
|
12
12
|
import utils from '../../gen/utils';
|
|
13
|
-
import { z } from '../../gen/schema';
|
|
13
|
+
import { z } from '../../gen/schema';
|
|
14
14
|
import { reducer } from '../../gen/reducer';
|
|
15
15
|
import * as creators from '../../gen/<%= module %>/creators';
|
|
16
16
|
import { <%= h.changeCase.pascal(documentType) %>Document } from '../../gen/types';
|
|
17
17
|
|
|
18
|
-
|
|
19
18
|
describe('<%= h.changeCase.pascal(module) %> Operations', () => {
|
|
20
19
|
let document: <%= h.changeCase.pascal(documentType) %>Document;
|
|
21
20
|
|
|
@@ -26,13 +25,17 @@ describe('<%= h.changeCase.pascal(module) %> Operations', () => {
|
|
|
26
25
|
<% actions.forEach(action => { _%>
|
|
27
26
|
it('should handle <%= h.changeCase.camel(action.name) %> operation', () => {
|
|
28
27
|
const input = generateMock(z.<%= h.changeCase.pascal(action.name) %>InputSchema());
|
|
29
|
-
const updatedDocument = reducer(
|
|
28
|
+
const updatedDocument = reducer(
|
|
29
|
+
document,
|
|
30
|
+
creators.<%= h.changeCase.camel(action.name) %>(input),
|
|
31
|
+
);
|
|
30
32
|
|
|
31
33
|
expect(updatedDocument.operations.<%= action.scope %>).toHaveLength(1);
|
|
32
|
-
expect(updatedDocument.operations.<%= action.scope %>[0].type).toBe(
|
|
34
|
+
expect(updatedDocument.operations.<%= action.scope %>[0].type).toBe(
|
|
35
|
+
'<%= h.changeCase.constant(action.name) %>',
|
|
36
|
+
);
|
|
33
37
|
expect(updatedDocument.operations.<%= action.scope %>[0].input).toStrictEqual(input);
|
|
34
38
|
expect(updatedDocument.operations.<%= action.scope %>[0].index).toEqual(0);
|
|
35
39
|
});
|
|
36
|
-
|
|
37
40
|
<% }); _%>
|
|
38
|
-
});
|
|
41
|
+
});
|