Commit ac070525 authored by Donald Cook's avatar Donald Cook

Small testing tweaks

parent 68cef200
......@@ -116,7 +116,8 @@ export default {
<input
ref="service-desk-incoming-email"
type="text"
class="form-control incoming-email"
class="form-control"
data-testid="incoming-email"
:placeholder="__('Incoming email')"
:aria-label="__('Incoming email')"
aria-describedby="incoming-email-describer"
......
......@@ -13,6 +13,7 @@ describe('ServiceDeskSetting', () => {
});
const findTemplateDropdown = () => wrapper.find('#service-desk-template-select');
const findIncomingEmail = () => wrapper.find('[data-testid="incoming-email"]');
describe('when isEnabled=true', () => {
describe('only isEnabled', () => {
......@@ -35,7 +36,7 @@ describe('ServiceDeskSetting', () => {
it('should see loading spinner and not the incoming email', () => {
expect(wrapper.find(GlLoadingIcon).exists()).toBe(true);
expect(wrapper.find('.incoming-email').exists()).toBe(false);
expect(findIncomingEmail().exists()).toBe(false);
});
});
});
......@@ -73,7 +74,7 @@ describe('ServiceDeskSetting', () => {
});
it('should see email and not the loading spinner', () => {
expect(wrapper.find('.incoming-email').element.value).toEqual(incomingEmail);
expect(findIncomingEmail().element.value).toEqual(incomingEmail);
expect(wrapper.find(GlLoadingIcon).exists()).toBe(false);
});
......@@ -101,25 +102,25 @@ describe('ServiceDeskSetting', () => {
});
it('should see custom email', () => {
expect(wrapper.find('.incoming-email').element.value).toEqual(customEmail);
expect(findIncomingEmail().element.value).toEqual(customEmail);
});
});
describe('customEmail is the same as incomingEmail', () => {
const customEmail = 'foo@bar.com';
const email = 'foo@bar.com';
beforeEach(() => {
wrapper = mount(ServiceDeskSetting, {
propsData: {
isEnabled: true,
incomingEmail: customEmail,
customEmail,
incomingEmail: email,
customEmail: email,
},
});
});
it('should see custom email', () => {
expect(wrapper.find('.incoming-email').element.value).toEqual(customEmail);
expect(findIncomingEmail().element.value).toEqual(email);
});
});
});
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment