Skip to content

Commit

Permalink
re-add test for invalid json
Browse files Browse the repository at this point in the history
  • Loading branch information
ndushay committed Feb 6, 2019
1 parent e3ae0e5 commit 7b9d2a7
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions __tests__/integration/schemaValidation.test.js
Expand Up @@ -88,5 +88,23 @@ describe('Editor', () => {
await pupExpect(page).not.toMatch('Edition Bad Schema')
})
})

describe('bad JSON', async () => {
let dialog
beforeAll(async() => {
const fileInput = await page.$('.DropZone input[type="file"]')
dialog = await pupExpect(page).toDisplayDialog(async () => {
await fileInput.uploadFile("__tests__/__fixtures__/ddc_bad_json.json")
})
})
it('displays dialog', async () => {
const exp_msg = "ERROR - CANNOT USE PROFILE/RESOURCE TEMPLATE: problem parsing JSON template: SyntaxError: Unexpected token } in JSON at position"
await expect(dialog.message()).toMatch(exp_msg)
})
it('does not populate form from loaded file', async () => {
await dialog.dismiss()
await pupExpect(page).not.toMatch('DDC Bad JSON')
})
})
})
})

0 comments on commit 7b9d2a7

Please sign in to comment.