Skip to content

Commit

Permalink
TASK: Adjust acceptance tests
Browse files Browse the repository at this point in the history
  • Loading branch information
markusguenther committed Mar 30, 2023
1 parent 5c0ca4f commit 73b78ef
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@ test('Switching dimensions', async t => {
const otherPageName = 'Untranslated page';

await Page.goToPage(translatedPageName);
await DimensionSwitcher.switchLanguageDimension('Latvian');
await DimensionSwitcher.switchSingleDimension('Latvian');
await t.click('#neos-NodeVariantCreationDialog-CreateEmpty');
await Page.waitForIframeLoading();
await t
.expect(await Page.getReduxState(state => state.cr.contentDimensions.active.language[0])).eql('lv', 'Dimension switched to Latvian')
.expect(Page.treeNode.withText(otherPageName).exists).notOk('Untranslated node gone from the tree');

subSection('Switch back to original dimension');
await DimensionSwitcher.switchLanguageDimension('English (US)');
await DimensionSwitcher.switchSingleDimension('English (US)');
await Page.waitForIframeLoading();
await t
.expect(await Page.getReduxState(state => state.cr.contentDimensions.active.language[0])).eql('en_US', 'Dimension back to English')
Expand Down
6 changes: 6 additions & 0 deletions Tests/IntegrationTests/pageModel.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,12 @@ export class DimensionSwitcher {
.click(this.dimensionSwitcherFirstDimensionSelector)
.click(this.dimensionSwitcherFirstDimensionSelectorWithShallowDropDownContents.find('li').withText(name));
}

static async switchSingleDimension(name) {
await t
.click(this.dimensionSwitcher)
.click(ReactSelector('DimensionSelectorOption').withProps('option', {label: name}));
}
}

export class PublishDropDown {
Expand Down

0 comments on commit 73b78ef

Please sign in to comment.