Skip to content

Commit

Permalink
Resolve a couple of behat issues (#2830)
Browse files Browse the repository at this point in the history
* FIX Correctly add message to reactstrap-confirm

* MNT Fix behat tests
  • Loading branch information
GuySartorelli authored Jan 29, 2023
1 parent 081eea4 commit b02beba
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 13 deletions.
4 changes: 2 additions & 2 deletions client/dist/js/bundle.js

Large diffs are not rendered by default.

5 changes: 3 additions & 2 deletions client/src/legacy/CMSMain.EditForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -497,12 +497,13 @@ $.entwine('ss', function($){
'By changing the URL segment visitors will not be able to view it.'
);

if (await reactConfirm(message, {
if (await reactConfirm({
title: i18n._t(
'CMS.RemoveHomePageWarningTitle',
'Remove your home page?'
),
confirmLabel: i18n._t(
message,
confirmText: i18n._t(
'CMS.RemoveHomePageWarningLabel',
'Remove'
),
Expand Down
5 changes: 3 additions & 2 deletions client/src/legacy/CMSMain.Tree.js
Original file line number Diff line number Diff line change
Expand Up @@ -169,12 +169,13 @@ $.entwine('ss.tree', function($) {
'By changing the URL segment visitors will not be able to view it.'
);

return await reactConfirm(message, {
return await reactConfirm({
title: i18n._t(
'CMS.RemoveHomePageWarningTitle',
'Remove your home page?'
),
confirmLabel: i18n._t(
message,
confirmText: i18n._t(
'CMS.RemoveHomePageWarningLabel',
'Remove'
),
Expand Down
2 changes: 1 addition & 1 deletion tests/behat/features/insert-a-link.feature
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ So that I can link to a external website or a page on my site
And I press the "Insert link" HTML field button
And I click "Page on this site" in the ".tox-collection__group" element
And I should see an "form#Form_editorInternalLink" element
Then I should see "About Us" in the ".treedropdownfield__value-container" element
Then I should see "About Us" in the "#Form_editorInternalLink_PageID_Holder .treedropdownfield__value-container" element
And the "Link description" field should contain "my desc"
# This doesn't seem to suffer from that issue
When I select "Home" in the "#Form_editorInternalLink_PageID_Holder" tree dropdown
Expand Down
12 changes: 6 additions & 6 deletions tests/behat/features/insert-anchor-link.feature
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ So that I can link to a external website or a page on my site
And I press the "Insert link" HTML field button
And I click "Anchor on a page" in the ".tox-collection__group" element
Then I should see an "form#Form_editorAnchorLink" element
And I should see "About Us" in the ".treedropdownfield__value-container" element
And I should see "About Us" in the "#Form_editorAnchorLink_PageID_Holder .treedropdownfield__value-container" element
When I select "Details" in the "#Form_editorAnchorLink_PageID_Holder" tree dropdown
And I select "youranchor" in the "#Form_editorAnchorLink_Anchor_Holder" anchor dropdown
Then I should see "youranchor" in the ".anchorselectorfield__value-container" element
Then I should see "youranchor" in the "#Form_editorAnchorLink_Anchor_Holder .anchorselectorfield__value-container" element
When I fill in "my desc" for "Link description"
And I press the "Insert link" button
Then the "Content" HTML field should contain "<a title="my desc" href="[sitetree_link,id=3]#youranchor">awesome</a>"
Expand All @@ -34,9 +34,9 @@ So that I can link to a external website or a page on my site
And I press the "Insert link" HTML field button
And I click "Anchor on a page" in the ".tox-collection__group" element
Then I should see an "form#Form_editorAnchorLink" element
And I should see "About Us" in the ".treedropdownfield__value-container" element
And I should see "About Us" in the "#Form_editorAnchorLink_PageID_Holder .treedropdownfield__value-container" element
When I select "dataobject-anchor" in the "#Form_editorAnchorLink_Anchor_Holder" anchor dropdown
Then I should see "dataobject-anchor" in the ".anchorselectorfield__value-container" element
Then I should see "dataobject-anchor" in the "#Form_editorAnchorLink_Anchor_Holder .anchorselectorfield__value-container" element
When I fill in "my desc" for "Link description"
And I press the "Insert link" button
Then the "Content" HTML field should contain "<a title="my desc" href="[sitetree_link,id=2]#dataobject-anchor">awesome</a>"
Expand All @@ -49,11 +49,11 @@ So that I can link to a external website or a page on my site
And I press the "Insert link" HTML field button
And I click "Anchor on a page" in the ".tox-collection__group" element
Then I should see an "form#Form_editorAnchorLink" element
And I should see "About Us" in the ".treedropdownfield__value-container" element
And I should see "About Us" in the "#Form_editorAnchorLink_PageID_Holder .treedropdownfield__value-container" element
When I click on the ".anchorselectorfield__dropdown-indicator" element
Then I should see "dataobject-anchor" in the ".anchorselectorfield__menu-list" element
When I select "unsaved-anchor" in the "#Form_editorAnchorLink_Anchor_Holder" anchor dropdown
Then I should see "unsaved-anchor" in the ".anchorselectorfield__value-container" element
Then I should see "unsaved-anchor" in the "#Form_editorAnchorLink_Anchor_Holder .anchorselectorfield__value-container" element
When I fill in "my desc" for "Link description"
And I press the "Insert link" button
Then the "Content" HTML field should contain "<a title="my desc" href="[sitetree_link,id=2]#unsaved-anchor">awesome</a>"
Expand Down

0 comments on commit b02beba

Please sign in to comment.