Commit b7a4b66f authored by Fernando's avatar Fernando

Add tests for conditional margin

* Check for margin when feature flag enabled/disabled
parent a2486975
...@@ -128,6 +128,7 @@ describe('AddLicenseForm', () => { ...@@ -128,6 +128,7 @@ describe('AddLicenseForm', () => {
vm.licenseName = 'FOO'; vm.licenseName = 'FOO';
Vue.nextTick(() => { Vue.nextTick(() => {
const feedbackElement = vm.$el.querySelectorAll('.text-secondary'); const feedbackElement = vm.$el.querySelectorAll('.text-secondary');
const formCheckElementMargin = vm.$el.querySelector('.form-check.mb-3');
expect(feedbackElement[0].innerText.trim()).toBe( expect(feedbackElement[0].innerText.trim()).toBe(
'Acceptable license to be used in the project', 'Acceptable license to be used in the project',
...@@ -136,6 +137,9 @@ describe('AddLicenseForm', () => { ...@@ -136,6 +137,9 @@ describe('AddLicenseForm', () => {
expect(feedbackElement[1].innerText.trim()).toBe( expect(feedbackElement[1].innerText.trim()).toBe(
'Disallow merge request if detected and will instruct developer to remove', 'Disallow merge request if detected and will instruct developer to remove',
); );
expect(formCheckElementMargin).not.toBeNull();
done(); done();
}); });
}); });
...@@ -145,8 +149,10 @@ describe('AddLicenseForm', () => { ...@@ -145,8 +149,10 @@ describe('AddLicenseForm', () => {
vm.licenseName = 'FOO'; vm.licenseName = 'FOO';
Vue.nextTick(() => { Vue.nextTick(() => {
const feedbackElement = vm.$el.querySelectorAll('.text-secondary'); const feedbackElement = vm.$el.querySelectorAll('.text-secondary');
const formCheckElementMargin = vm.$el.querySelector('.form-check.mb-3');
expect(feedbackElement.length).toBe(0); expect(feedbackElement.length).toBe(0);
expect(formCheckElementMargin).toBeNull();
done(); done();
}); });
}); });
......
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