Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix functional tests for alerting UI enhancements #1

Merged
merged 1 commit into from
Apr 17, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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