-
Notifications
You must be signed in to change notification settings - Fork 63
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f5eb816
commit c2279ea
Showing
3 changed files
with
44 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
packages/amplify-codegen-e2e-tests/schemas/admin-modelgen.graphql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
input AMPLIFY { globalAuthRule: AuthRule = { allow: public } } # FOR TESTING ONLY! | ||
|
||
type Todo @model { | ||
id: ID! | ||
name: String! | ||
description: String | ||
} | ||
input CustomInput { | ||
customField1: String! | ||
customField2: Int | ||
} | ||
|
||
type Query { | ||
getAllTodo(msg: String, input: CustomInput): String @function(name: "echofunction-${env}") | ||
} |
19 changes: 19 additions & 0 deletions
19
packages/amplify-codegen-e2e-tests/src/__tests__/push-codegen-admin-modelgen.test.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import { DEFAULT_JS_CONFIG, createNewProjectDir } from "@aws-amplify/amplify-codegen-e2e-core"; | ||
import { deleteAmplifyProject, testPushCodegen } from "../codegen-tests-base"; | ||
|
||
const schema = 'admin-modelgen.graphql'; | ||
|
||
describe('Amplify push with codegen tests - admin modelgen', () => { | ||
let projectRoot: string; | ||
beforeEach(async () => { | ||
projectRoot = await createNewProjectDir('pushCodegenAdminModelgen'); | ||
}); | ||
|
||
afterEach(async () => { | ||
await deleteAmplifyProject(projectRoot); | ||
}); | ||
|
||
it(`should not throw error for executing the modelgen commands (datastore modelgen & model-introspection) post push`, async () => { | ||
await testPushCodegen(DEFAULT_JS_CONFIG, projectRoot, schema); | ||
}); | ||
}); |