Skip to content

Commit

Permalink
Merge pull request #1 from mikecote/pr/63515
Browse files Browse the repository at this point in the history
Fix functional tests for alerting UI enhancements
  • Loading branch information
andreadelrio authored Apr 17, 2020
2 parents fa62385 + 4275ae9 commit b84819d
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ export const CollapsedItemActions: React.FunctionComponent<ComponentOpts> = ({
disabled={!canSave}
compressed
checked={!item.enabled}
data-test-subj="enableSwitch"
data-test-subj="disableSwitch"
onChange={async () => {
if (item.enabled) {
await disableAlert(item);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -343,15 +343,15 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => {

await testSubjects.click('collapsedItemActions');

await pageObjects.triggersActionsUI.toggleSwitch('enableSwitch');
await pageObjects.triggersActionsUI.toggleSwitch('disableSwitch');

await pageObjects.triggersActionsUI.searchAlerts(createdAlert.name);

await testSubjects.click('collapsedItemActions');

const enableSwitchAfterDisable = await testSubjects.find('enableSwitch');
const isChecked = await enableSwitchAfterDisable.getAttribute('aria-checked');
expect(isChecked).to.eql('false');
const disableSwitchAfterDisable = await testSubjects.find('disableSwitch');
const isChecked = await disableSwitchAfterDisable.getAttribute('aria-checked');
expect(isChecked).to.eql('true');
});

it('should re-enable single alert', async () => {
Expand All @@ -361,21 +361,21 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => {

await testSubjects.click('collapsedItemActions');

await pageObjects.triggersActionsUI.toggleSwitch('enableSwitch');
await pageObjects.triggersActionsUI.toggleSwitch('disableSwitch');

await pageObjects.triggersActionsUI.searchAlerts(createdAlert.name);

await testSubjects.click('collapsedItemActions');

await pageObjects.triggersActionsUI.toggleSwitch('enableSwitch');
await pageObjects.triggersActionsUI.toggleSwitch('disableSwitch');

await pageObjects.triggersActionsUI.searchAlerts(createdAlert.name);

await testSubjects.click('collapsedItemActions');

const enableSwitchAfterReEnable = await testSubjects.find('enableSwitch');
const isChecked = await enableSwitchAfterReEnable.getAttribute('aria-checked');
expect(isChecked).to.eql('true');
const disableSwitchAfterReEnable = await testSubjects.find('disableSwitch');
const isChecked = await disableSwitchAfterReEnable.getAttribute('aria-checked');
expect(isChecked).to.eql('false');
});

it('should mute single alert', async () => {
Expand Down Expand Up @@ -507,9 +507,9 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => {

await testSubjects.click('collapsedItemActions');

const enableSwitch = await testSubjects.find('enableSwitch');
const isChecked = await enableSwitch.getAttribute('aria-checked');
expect(isChecked).to.eql('false');
const disableSwitch = await testSubjects.find('disableSwitch');
const isChecked = await disableSwitch.getAttribute('aria-checked');
expect(isChecked).to.eql('true');
});

it('should enable all selection', async () => {
Expand All @@ -532,9 +532,9 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => {

await testSubjects.click('collapsedItemActions');

const enableSwitch = await testSubjects.find('enableSwitch');
const isChecked = await enableSwitch.getAttribute('aria-checked');
expect(isChecked).to.eql('true');
const disableSwitch = await testSubjects.find('disableSwitch');
const isChecked = await disableSwitch.getAttribute('aria-checked');
expect(isChecked).to.eql('false');
});

it('should delete all selection', async () => {
Expand Down

0 comments on commit b84819d

Please sign in to comment.