Commit 998b460e authored by Alexander Turinske's avatar Alexander Turinske

Clean up tests

parent ef35231e
......@@ -285,21 +285,18 @@ describe('DAST Scanner Profile', () => {
});
describe('when profile does not come from a policy', () => {
let formGroups;
beforeEach(() => {
createComponent({
propsData: {
profile: defaultProfile,
},
});
formGroups = findAllFormGroups().wrappers;
});
it('should enable all form groups', () => {
formGroups.forEach((formGroup) => {
expect(formGroup.attributes('disabled')).toBe(undefined);
});
expect(
findAllFormGroups().wrappers.every((w) => w.attributes('disabled') === undefined),
).toBe(true);
});
it('should show the policy profile alert', () => {
......@@ -308,15 +305,12 @@ describe('DAST Scanner Profile', () => {
});
describe('when profile does comes from a policy', () => {
let formGroups;
beforeEach(() => {
createComponent({
propsData: {
profile: policyScannerProfile,
},
});
formGroups = findAllFormGroups().wrappers;
});
it('should show the policy profile alert', () => {
......@@ -324,9 +318,9 @@ describe('DAST Scanner Profile', () => {
});
it('should disable all form groups', () => {
formGroups.forEach((formGroup) => {
expect(formGroup.attributes('disabled')).toBe('true');
});
expect(findAllFormGroups().wrappers.every((w) => w.attributes('disabled') === 'true')).toBe(
true,
);
});
it('should disable the save button', () => {
......
......@@ -121,20 +121,18 @@ describe('DastSiteAuthSection', () => {
describe('when profile does not come from a policy', () => {
it('should enable all form groups', () => {
createComponent({ mountFn: shallowMount, fields: { enabled: true } });
const formGroups = findAllFormGroups().wrappers;
formGroups.forEach((formGroup) => {
expect(formGroup.attributes('disabled')).toBe(undefined);
});
expect(
findAllFormGroups().wrappers.every((w) => w.attributes('disabled') === undefined),
).toBe(true);
});
});
describe('when profile does comes from a policy', () => {
it('should disable all form groups', () => {
createComponent({ mountFn: shallowMount, disabled: true, fields: { enabled: true } });
const formGroups = findAllFormGroups().wrappers;
formGroups.forEach((formGroup) => {
expect(formGroup.attributes('disabled')).toBe('true');
});
expect(findAllFormGroups().wrappers.every((w) => w.attributes('disabled') === 'true')).toBe(
true,
);
});
});
});
......
......@@ -346,10 +346,9 @@ describe('DastSiteProfileForm', () => {
});
it('should enable all form groups', () => {
const formGroups = findAllFormGroups();
for (let i = 0; i < formGroups.length; i += 1) {
expect(formGroups.at(i).attributes('disabled')).toBe(undefined);
}
expect(
findAllFormGroups().wrappers.every((w) => w.attributes('disabled') === undefined),
).toBe(true);
});
it('should show the policy profile alert', () => {
......@@ -371,10 +370,9 @@ describe('DastSiteProfileForm', () => {
});
it('should disable all form groups', () => {
const formGroups = findAllFormGroups();
for (let i = 0; i < formGroups.length; i += 1) {
expect(formGroups.at(i).attributes('disabled')).toBe('true');
}
expect(findAllFormGroups().wrappers.every((w) => w.attributes('disabled') === 'true')).toBe(
true,
);
});
it('should disable the save button', () => {
......
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