Skip to content

Commit

Permalink
fix functional tests, fix i18n
Browse files Browse the repository at this point in the history
  • Loading branch information
ThomThomson committed Feb 14, 2021
1 parent 5cac426 commit 5ae820e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/plugins/dashboard/public/dashboard_strings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ export const leaveConfirmStrings = {
defaultMessage: 'Leave edit mode with unsaved work?',
}),
getLeaveEditModeSubtitle: () =>
i18n.translate('dashboard.changeViewModeConfirmModal.discardChangesDescription', {
i18n.translate('dashboard.changeViewModeConfirmModal.discardChangesOptionalDescription', {
defaultMessage: `If you discard your changes, there's no getting them back.`,
}),
getDiscardTitle: () =>
Expand Down
12 changes: 8 additions & 4 deletions test/functional/page_objects/dashboard_page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -250,17 +250,21 @@ export function DashboardPageProvider({ getService, getPageObjects }: FtrProvide
log.debug('clickCancelOutOfEditMode');
await testSubjects.click('dashboardViewOnlyMode');
if (accept) {
await testSubjects.exists('dashboardDiscardConfirmKeep');
await testSubjects.click('dashboardDiscardConfirmKeep');
const confirmation = await testSubjects.exists('dashboardDiscardConfirmKeep');
if (confirmation) {
await testSubjects.click('dashboardDiscardConfirmKeep');
}
}
}

public async clickDiscardChanges(accept = true) {
log.debug('clickDiscardChanges');
await testSubjects.click('dashboardViewOnlyMode');
if (accept) {
await testSubjects.exists('dashboardDiscardConfirmDiscard');
await testSubjects.click('dashboardDiscardConfirmDiscard');
const confirmation = await testSubjects.exists('dashboardDiscardConfirmDiscard');
if (confirmation) {
await testSubjects.click('dashboardDiscardConfirmDiscard');
}
}
}

Expand Down

0 comments on commit 5ae820e

Please sign in to comment.