Commit 953f690e authored by Alexander Turinske's avatar Alexander Turinske

Apply 5 suggestion(s) to 1 file(s)

parent 96ee9d72
...@@ -236,12 +236,12 @@ spec: ...@@ -236,12 +236,12 @@ spec:
}); });
it('adds a new rule', async () => { it('adds a new rule', async () => {
expect(wrapper.findAll(PolicyRuleBuilder)).toHaveLength(1); expect(wrapper.findAllComponents(PolicyRuleBuilder)).toHaveLength(1);
const button = findAddRuleButton(); const button = findAddRuleButton();
button.vm.$emit('click'); button.vm.$emit('click');
button.vm.$emit('click'); button.vm.$emit('click');
await wrapper.vm.$nextTick(); await wrapper.vm.$nextTick();
const elements = wrapper.findAll(PolicyRuleBuilder); const elements = wrapper.findAllComponents(PolicyRuleBuilder);
expect(elements).toHaveLength(3); expect(elements).toHaveLength(3);
elements.wrappers.forEach((builder, idx) => { elements.wrappers.forEach((builder, idx) => {
...@@ -259,11 +259,11 @@ spec: ...@@ -259,11 +259,11 @@ spec:
it('removes a new rule', async () => { it('removes a new rule', async () => {
findAddRuleButton().vm.$emit('click'); findAddRuleButton().vm.$emit('click');
await wrapper.vm.$nextTick(); await wrapper.vm.$nextTick();
expect(wrapper.findAll(PolicyRuleBuilder)).toHaveLength(2); expect(wrapper.findAllComponents(PolicyRuleBuilder)).toHaveLength(2);
findPolicyRuleBuilder().vm.$emit('remove'); findPolicyRuleBuilder().vm.$emit('remove');
await wrapper.vm.$nextTick(); await wrapper.vm.$nextTick();
expect(wrapper.findAll(PolicyRuleBuilder)).toHaveLength(1); expect(wrapper.findAllComponents(PolicyRuleBuilder)).toHaveLength(1);
}); });
it('updates yaml editor value on switch to yaml editor', async () => { it('updates yaml editor value on switch to yaml editor', async () => {
...@@ -371,7 +371,7 @@ spec: ...@@ -371,7 +371,7 @@ spec:
it('presents existing policy', () => { it('presents existing policy', () => {
expect(findPolicyName().attributes().value).toEqual('policy'); expect(findPolicyName().attributes().value).toEqual('policy');
expect(wrapper.findAll(PolicyRuleBuilder).length).toEqual(1); expect(wrapper.findAllComponents(PolicyRuleBuilder)).toHaveLength(1);
}); });
it('updates existing policy and redirects to a threat monitoring path', async () => { it('updates existing policy and redirects to a threat monitoring path', async () => {
......
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