-
-
Notifications
You must be signed in to change notification settings - Fork 135
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
FEATURE: Display number of validation errors for each tab in inspector (
- Loading branch information
1 parent
2bd0523
commit d2e1c94
Showing
7 changed files
with
147 additions
and
2 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
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
69 changes: 69 additions & 0 deletions
69
Tests/IntegrationTests/Fixtures/1Dimension/inspectorValidation.e2e.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,69 @@ | ||
import {Selector} from 'testcafe'; | ||
import {ReactSelector} from 'testcafe-react-selectors'; | ||
import {beforeEach, subSection, checkPropTypes} from './../../utils.js'; | ||
import {Page} from './../../pageModel'; | ||
|
||
/* global fixture:true */ | ||
|
||
fixture`InspectorValidation`.beforeEach(beforeEach).afterEach(() => checkPropTypes()); | ||
|
||
const InspectorTitleProperty = Selector( | ||
'#__neos__editor__property---title' | ||
); | ||
const InspectorUriPathSegmentProperty = Selector( | ||
'#__neos__editor__property---uriPathSegment' | ||
); | ||
const activeTabMenuItem = ReactSelector('TabMenuItem').withProps('isActive', true); | ||
|
||
test('Remove homepage title to get one error', async t => { | ||
await Page.waitForIframeLoading(t); | ||
|
||
subSection('Remove homepage title'); | ||
await t | ||
.typeText(InspectorTitleProperty, ' ', {replace: true}) | ||
.pressKey('backspace') | ||
.expect(InspectorTitleProperty.value).eql(''); | ||
|
||
subSection('Check error badge for one error'); | ||
const badge = await activeTabMenuItem.findReact('Badge'); | ||
await t | ||
.expect(await badge.getReact(({props}) => props.label)) | ||
.eql('1', 'The badge shows one validation error in Props'); | ||
}); | ||
|
||
test('Remove homepage title and URI segment to get two errors', async t => { | ||
subSection('Clean title and uri path segment field'); | ||
await t | ||
.typeText(InspectorTitleProperty, ' ', {replace: true}) | ||
.pressKey('backspace') | ||
.typeText(InspectorUriPathSegmentProperty, ' ', {replace: true}) | ||
.pressKey('backspace'); | ||
|
||
subSection('Check error badge for two errors'); | ||
const badge = await activeTabMenuItem.findReact('Badge'); | ||
await t | ||
.expect(await badge.getReact(({props}) => props.label)) | ||
.eql('2', 'The badge shows two validation errors in Props'); | ||
}); | ||
|
||
test('Remove homepage title to get one error and resolve error by new title', async t => { | ||
subSection('Remove homepage title'); | ||
await t | ||
.typeText(InspectorTitleProperty, ' ', {replace: true}) | ||
.pressKey('backspace') | ||
.expect(InspectorTitleProperty.value).eql(''); | ||
|
||
subSection('Check error badge for one error'); | ||
let badge = await activeTabMenuItem.findReact('Badge'); | ||
await t | ||
.expect(await badge.getReact(({props}) => props.label)) | ||
.eql('1', 'The badge shows one validation error in Props'); | ||
|
||
subSection('Enter new title Home'); | ||
await t | ||
.typeText(InspectorTitleProperty, 'Home', {replace: true}); | ||
badge = await activeTabMenuItem.findReact('Badge'); | ||
await t | ||
.expect(await badge.getReact(({props}) => props.label)) | ||
.eql(null, 'The badge is not existing'); | ||
}); |
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
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