1
- import { mount } from '@vue/test-utils' ;
1
+ import { mount , shallowMount } from '@vue/test-utils' ;
2
2
import axios from 'axios' ;
3
3
import { describe , expect , it , vi , beforeAll } from 'vitest' ;
4
4
import { createTestingPinia } from '@pinia/testing' ;
@@ -9,6 +9,7 @@ import detailed_findings from '@/../tests/resources/mock_detailed_findings2.json
9
9
import flushPromises from 'flush-promises' ;
10
10
import FindingTableHeader from '@/components/Findings/FindingTableHeader.vue' ;
11
11
import Panel from 'primevue/panel' ;
12
+ import FindingPanel from '@/components/ScanFindings/FindingPanel.vue' ;
12
13
13
14
importFA ( ) ;
14
15
@@ -45,7 +46,8 @@ describe('FindingsTable tests', () => {
45
46
} ,
46
47
global : {
47
48
plugins : [ createTestingPinia ( ) ] ,
48
- stubs : { } ,
49
+ stubs : {
50
+ } ,
49
51
directives : {
50
52
tooltip,
51
53
} ,
@@ -89,7 +91,7 @@ describe('FindingsTable tests', () => {
89
91
}
90
92
} ) ;
91
93
92
- const wrapper = mount ( App , {
94
+ const wrapper = shallowMount ( App , {
93
95
props : {
94
96
findings : detailed_findings . data ,
95
97
isRuleFinding : true ,
@@ -100,7 +102,9 @@ describe('FindingsTable tests', () => {
100
102
} ,
101
103
global : {
102
104
plugins : [ createTestingPinia ( ) ] ,
103
- stubs : { } ,
105
+ stubs : {
106
+ FindingPanel
107
+ } ,
104
108
directives : {
105
109
tooltip,
106
110
} ,
@@ -158,15 +162,6 @@ describe('FindingsTable tests', () => {
158
162
expect ( ( ) => wrapper . vm . markAllAsTruePositive ( ) ) . not . toThrow ( ) ;
159
163
expect ( ( ) => wrapper . vm . markAllAsGone ( ) ) . not . toThrow ( ) ;
160
164
expect ( ( ) => wrapper . vm . auditThis ( ) ) . not . toThrow ( ) ;
161
-
162
- expect ( ( ) => wrapper . find ( '#filterFiles' ) . setValue ( 'file1' ) ) . not . toThrow ( ) ;
163
- await flushPromises ( ) ;
164
- expect ( ( ) => wrapper . find ( '#filterFiles' ) . setValue ( 'fi*' ) ) . not . toThrow ( ) ;
165
- await flushPromises ( ) ;
166
- expect ( ( ) => wrapper . find ( '#filterFiles' ) . setValue ( '*e1' ) ) . not . toThrow ( ) ;
167
-
168
- axios . get . mockResolvedValueOnce ( { data : detailed_findings } ) ;
169
- expect ( ( ) => wrapper . vm . updateAudit ( 'NOT_ANALYZED' , 'Rien a declarer' ) ) . not . toThrow ( ) ;
170
165
} ) ;
171
166
172
167
it ( 'Given a FindingsTable in repository then FindingsTable will be displayed' , ( ) => {
@@ -212,7 +207,8 @@ describe('FindingsTable tests', () => {
212
207
} ,
213
208
global : {
214
209
plugins : [ createTestingPinia ( ) ] ,
215
- stubs : { } ,
210
+ stubs : {
211
+ } ,
216
212
directives : {
217
213
tooltip,
218
214
} ,
0 commit comments