Skip to content
代码片段 群组 项目
提交 063baf20 编辑于 作者: Savas Vedova's avatar Savas Vedova 提交者: Frédéric Caplette
浏览文件

Fix vulnerability validation bug

Emit changes when a new row is added so that validation works properly.
上级 9d954d9e
No related branches found
No related tags found
无相关合并请求
......@@ -21,6 +21,11 @@ export default {
identifiers: [{ identifierCode: '', identifierUrl: '' }],
};
},
watch: {
identifiers() {
this.emitChanges();
},
},
methods: {
emitChanges() {
this.$emit('change', {
......@@ -35,7 +40,6 @@ export default {
},
removeIdentifier(index) {
this.identifiers.splice(index, 1);
this.emitChanges();
},
// null is when the user didn't input anything yet
// false when the user provided invalid input and
......
......@@ -80,6 +80,13 @@ describe('New vulnerability - Section Identifiers', () => {
expect(findIdentifierRows()).toHaveLength(2);
expect(wrapper.emitted('change')[0][0]).toEqual({
identifiers: [
{ name: '', url: '' },
{ name: '', url: '' },
],
});
wrapper.findByLabelText('Remove identifier row').trigger('click');
await nextTick();
......
0% 加载中 .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册