-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
PropertyComponent: display textFieldType error case to user
- Loading branch information
Showing
5 changed files
with
77 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
{ | ||
"id": "Sinopia:RT:Fixture:LookupWithValueTemplateRefs", | ||
"resourceURI": "http://examples.org/bogusOntologies/Resource", | ||
"remark": "This is a sample Resource Template, content is meaningless", | ||
"resourceLabel": "test lookup type misconfigured with valueTemplateRefs", | ||
"author": "surrogate for Nancy Lorimer", | ||
"schema": "https://ld4p.github.io/sinopia/schemas/0.0.9/resource-template.json", | ||
"propertyTemplates": [ | ||
{ | ||
"mandatory": "false", | ||
"repeatable": "true", | ||
"type": "lookup", | ||
"valueConstraint": { | ||
"defaults": [], | ||
"useValuesFrom": [], | ||
"valueDataType": {}, | ||
"valueTemplateRefs": [ | ||
"resourceTemplate:bf2:Note" | ||
] | ||
}, | ||
"propertyLabel": "lookup type with valueTemplateRefs", | ||
"propertyURI": "http://examples.org/bogusOntologies/lookup1" | ||
}, | ||
{ | ||
"mandatory": "false", | ||
"repeatable": "true", | ||
"type": "resource", | ||
"valueConstraint": { | ||
"defaults": [], | ||
"useValuesFrom": [], | ||
"valueDataType": {}, | ||
"valueTemplateRefs": [ | ||
"resourceTemplate:bf2:Title:Note" | ||
] | ||
}, | ||
"propertyLabel": "resource type with valueTemplateRefs", | ||
"propertyURI": "http://examples.org/bogusOntologies/lookup2" | ||
} | ||
] | ||
} |
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
22 changes: 22 additions & 0 deletions
22
__tests__/integration/propertyTemplateMisconfigured.test.js
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,22 @@ | ||
// Copyright 2019 Stanford University see LICENSE for license | ||
|
||
import pupExpect from 'expect-puppeteer' | ||
import { testUserLogin } from './loginHelper' | ||
|
||
describe('Errors with Misconfigured Property Templates', () => { | ||
beforeAll(async () => { | ||
await testUserLogin() | ||
}) | ||
|
||
beforeEach(async () => { | ||
await page.goto('http://127.0.0.1:8888/templates') | ||
await page.waitForSelector('.react-bootstrap-table') | ||
}) | ||
|
||
it('lookup type misconfigured with valueTemplateRefs', async () => { | ||
// expect.assertions(3) | ||
await pupExpect(page).toClick('a[href="/editor"]', { text: 'test lookup type misconfigured with valueTemplateRefs' }) | ||
await pupExpect(page).toClick('button.btn-add[data-id="lookup1"]') | ||
await pupExpect(page).toMatch('This propertyTemplate should not be of type lookup.') | ||
}) | ||
}) |
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
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