@@ -6,9 +6,9 @@ import { useSearchParams } from "react-router-dom";
6
6
import { delay , http , HttpHandler , HttpResponse } from "msw" ;
7
7
import { mockAlert } from "../../../../mocks/msw/mockers/alert.mock" ;
8
8
import { AlertsFilterView } from "../../hooks/use-messages-filter-search-params" ;
9
- import { TableMessages } from "../table-messages" ;
10
9
import { hrefs } from "@/lib/hrefs" ;
11
10
import { mswEndpoint } from "@/test/msw-endpoint" ;
11
+ import { TableMessagesEmptyState } from "../table-messages-empty-state" ;
12
12
13
13
enum IllustrationTestId {
14
14
ALERT = "illustration-alert" ,
@@ -48,7 +48,7 @@ type TestCase = {
48
48
vi . mock ( "react-router-dom" , async ( ) => {
49
49
const original =
50
50
await vi . importActual < typeof import ( "react-router-dom" ) > (
51
- "react-router-dom"
51
+ "react-router-dom" ,
52
52
) ;
53
53
return {
54
54
...original ,
@@ -59,7 +59,7 @@ vi.mock("react-router-dom", async () => {
59
59
vi . mock ( "@stacklok/ui-kit" , async ( ) => {
60
60
const original =
61
61
await vi . importActual < typeof import ( "@stacklok/ui-kit" ) > (
62
- "@stacklok/ui-kit"
62
+ "@stacklok/ui-kit" ,
63
63
) ;
64
64
return {
65
65
...original ,
@@ -116,7 +116,7 @@ const TEST_CASES: TestCase[] = [
116
116
mswEndpoint ( "/api/v1/workspaces/:workspace_name/messages" ) ,
117
117
( ) => {
118
118
return HttpResponse . json ( [ ] ) ;
119
- }
119
+ } ,
120
120
) ,
121
121
] ,
122
122
searchParams : {
@@ -158,9 +158,9 @@ const TEST_CASES: TestCase[] = [
158
158
mswEndpoint ( "/api/v1/workspaces/:workspace_name/messages" ) ,
159
159
( ) => {
160
160
return HttpResponse . json (
161
- Array . from ( { length : 10 } , ( ) => mockAlert ( { type : "malicious" } ) )
161
+ Array . from ( { length : 10 } , ( ) => mockAlert ( { type : "malicious" } ) ) ,
162
162
) ;
163
- }
163
+ } ,
164
164
) ,
165
165
] ,
166
166
searchParams : { search : "foo-bar" , view : AlertsFilterView . ALL } ,
@@ -202,7 +202,7 @@ const TEST_CASES: TestCase[] = [
202
202
mswEndpoint ( "/api/v1/workspaces/:workspace_name/messages" ) ,
203
203
( ) => {
204
204
return HttpResponse . json ( [ ] ) ;
205
- }
205
+ } ,
206
206
) ,
207
207
] ,
208
208
searchParams : {
@@ -248,9 +248,9 @@ const TEST_CASES: TestCase[] = [
248
248
mswEndpoint ( "/api/v1/workspaces/:workspace_name/messages" ) ,
249
249
( ) => {
250
250
return HttpResponse . json (
251
- Array . from ( { length : 10 } ) . map ( ( ) => mockAlert ( { type : "secret" } ) )
251
+ Array . from ( { length : 10 } ) . map ( ( ) => mockAlert ( { type : "secret" } ) ) ,
252
252
) ;
253
- }
253
+ } ,
254
254
) ,
255
255
] ,
256
256
searchParams : {
@@ -291,10 +291,10 @@ const TEST_CASES: TestCase[] = [
291
291
( ) => {
292
292
return HttpResponse . json (
293
293
Array . from ( { length : 10 } ) . map ( ( ) =>
294
- mockAlert ( { type : "malicious" } )
295
- )
294
+ mockAlert ( { type : "malicious" } ) ,
295
+ ) ,
296
296
) ;
297
- }
297
+ } ,
298
298
) ,
299
299
] ,
300
300
searchParams : {
@@ -321,11 +321,13 @@ test.each(TEST_CASES)("$testDescription", async (testCase) => {
321
321
( ) => { } ,
322
322
] ) ;
323
323
324
- const { getByText, getByRole, getByTestId } = render ( < TableMessages /> ) ;
324
+ const { getByText, getByRole, getByTestId } = render (
325
+ < TableMessagesEmptyState /> ,
326
+ ) ;
325
327
326
328
await waitFor ( ( ) => {
327
329
expect (
328
- getByRole ( "heading" , { level : 4 , name : testCase . expected . title } )
330
+ getByRole ( "heading" , { level : 4 , name : testCase . expected . title } ) ,
329
331
) . toBeVisible ( ) ;
330
332
expect ( getByText ( testCase . expected . body ) ) . toBeVisible ( ) ;
331
333
expect ( getByTestId ( testCase . expected . illustrationTestId ) ) . toBeVisible ( ) ;
0 commit comments