Skip to content

Commit

Permalink
Update the rest of calls to fillForm (saved_object_tagging scope)
Browse files Browse the repository at this point in the history
  • Loading branch information
gsoldevila committed Oct 30, 2023
1 parent fc8fc02 commit cde26a5
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 13 deletions.
20 changes: 16 additions & 4 deletions x-pack/test/saved_object_tagging/functional/tests/create.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,10 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) {
description: 'The name will fails validation',
color: '#FF00CC',
},
{ submit: true }
{
submit: true,
clearWithKeyboard: true,
}
);

expect(await tagModal.isOpened()).to.be(true);
Expand All @@ -86,7 +89,10 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) {
description: 'The name will fails validation',
color: '#FF00CC',
},
{ submit: true }
{
submit: true,
clearWithKeyboard: true,
}
);

expect(await tagModal.isOpened()).to.be(true);
Expand All @@ -96,7 +102,10 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) {
{
name: 'valid name',
},
{ submit: true }
{
submit: true,
clearWithKeyboard: true,
}
);

await tagModal.waitUntilClosed();
Expand All @@ -116,7 +125,10 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) {
description: 'I will not add this tag',
color: '#FF00CC',
},
{ submit: false }
{
submit: false,
clearWithKeyboard: true,
}
);
await tagModal.clickCancel();
await tagModal.waitUntilClosed();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) {
},
{
submit: true,
clearWithKeyboard: true,
}
);

Expand Down
39 changes: 30 additions & 9 deletions x-pack/test/saved_object_tagging/functional/tests/edit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,10 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) {
description: 'This was edited',
color: '#FFCC00',
},
{ submit: true }
{
submit: true,
clearWithKeyboard: true,
}
);
await tagModal.waitUntilClosed();
await tagManagementPage.waitUntilTableIsLoaded();
Expand All @@ -79,7 +82,10 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) {
{
name: 'a',
},
{ submit: true }
{
submit: true,
clearWithKeyboard: true,
}
);

expect(await tagModal.isOpened()).to.be(true);
Expand All @@ -98,7 +104,10 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) {
description: 'edited description',
color: '#FF00CC',
},
{ submit: true }
{
submit: true,
clearWithKeyboard: true,
}
);

expect(await tagModal.isOpened()).to.be(true);
Expand All @@ -108,7 +117,10 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) {
{
name: 'edited name',
},
{ submit: true }
{
submit: true,
clearWithKeyboard: true,
}
);

await tagModal.waitUntilClosed();
Expand All @@ -130,7 +142,10 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) {
description: 'I will not add this tag',
color: '#FF00CC',
},
{ submit: false }
{
submit: false,
clearWithKeyboard: true,
}
);
await tagModal.clickCancel();
await tagModal.waitUntilClosed();
Expand All @@ -153,28 +168,34 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) {
it('should disable save button if no property is changed', async () => {
await tagModal.openEdit('tag-3');

await tagModal.fillForm(tag3Unmodified, { submit: false });
await tagModal.fillForm(tag3Unmodified, { submit: false, clearWithKeyboard: true });
expect(await tagModal.isConfirmDisabled()).to.be(true);
});
it('should enable save button if name is changed', async () => {
await tagModal.openEdit('tag-3');

await tagModal.fillForm({ ...tag3Unmodified, name: 'changed name' }, { submit: false });
await tagModal.fillForm(
{ ...tag3Unmodified, name: 'changed name' },
{ submit: false, clearWithKeyboard: true }
);
expect(await tagModal.isConfirmDisabled()).to.be(false);
});
it('should enable save button if description is changed', async () => {
await tagModal.openEdit('tag-3');

await tagModal.fillForm(
{ ...tag3Unmodified, description: 'changed description' },
{ submit: false }
{ submit: false, clearWithKeyboard: true }
);
expect(await tagModal.isConfirmDisabled()).to.be(false);
});
it('should enable save button if color is changed', async () => {
await tagModal.openEdit('tag-3');

await tagModal.fillForm({ ...tag3Unmodified, color: '#FF0000' }, { submit: false });
await tagModal.fillForm(
{ ...tag3Unmodified, color: '#FF0000' },
{ submit: false, clearWithKeyboard: true }
);
expect(await tagModal.isConfirmDisabled()).to.be(false);
});
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) {
},
{
submit: true,
clearWithKeyboard: true,
}
);

Expand Down

0 comments on commit cde26a5

Please sign in to comment.