Skip to content

Commit

Permalink
Update the custom schema
Browse files Browse the repository at this point in the history
  • Loading branch information
anjula-sack committed Aug 22, 2023
1 parent 291783a commit 9545978
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 12 deletions.
4 changes: 3 additions & 1 deletion e2e/specs/create-form-using-custom-schema.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@ test("Create a form using a custom JSON schema", async ({ page }) => {
});

await test.step("Then I paste in a custom JSON schema into the schema editor and click the `Render Changes` button", async () => {
await formBuilderPage.schemaInput().fill(JSON.stringify(customSchema));
await formBuilderPage
.schemaInput()
.fill(JSON.stringify(customSchema, null, 2));
await formBuilderPage.renderChangesButton().click();
});

Expand Down
17 changes: 8 additions & 9 deletions e2e/specs/interactive-builder.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,13 @@ test("Create a schema using the interactive builder", async ({ page }) => {

await test.step("Then I should see the new schema in the schema editor and a success notification", async () => {
await expect(page.getByText(/new question created/i)).toBeVisible();
await expect(
page
.getByRole("tabpanel", { name: "Schema Editor" })
.locator("div")
.filter({
hasText: '{ "name": "Covid-19 Screening"',
})
.nth(2)
).toBeVisible();
await page
.locator("#schemaEditor div")
.filter({
hasText:
'{ "name": "Covid-19 Screening", "pages": [ { "label": "Screening", "sections": [',
})
.nth(1)
.click();
});
});
5 changes: 3 additions & 2 deletions e2e/support/custom-schema.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"encounterType": "",
"encounterType": "e22e39fd-7db2-45e7-80f1-60fa0d5a4378",
"name": "UI Select Form Test",
"pages": [
{
Expand All @@ -26,5 +26,6 @@
"processor": "EncounterFormProcessor",
"referencedForms": [],
"uuid": "xxx",
"version": 1
"version": "1",
"description": "This is test description"
}

0 comments on commit 9545978

Please sign in to comment.