@@ -38,13 +38,19 @@ describe('posts should work', () => {
3838} )
3939
4040describe ( 'comment should work' , ( ) => {
41- it ( 'get should work' , async ( ) => {
41+ it ( 'list should work' , async ( ) => {
4242 const result = await api . comments . listPrimary (
4343 'ORIGINAL_POST' ,
44- '61c0d39877abf80010426ba3 '
44+ '65071ec94101002b06c3469d '
4545 )
4646 expect ( isSuccess ( result ) ) . toBe ( true )
4747 expect ( result . data . data . length ) . greaterThan ( 0 )
48+
49+ const comments = await api . comments . list (
50+ 'ORIGINAL_POST' ,
51+ result . data . data [ 0 ] . threadId
52+ )
53+ expect ( comments . data . data . length ) . greaterThan ( 0 )
4854 } )
4955
5056 it ( 'like should work' , async ( ) => {
@@ -75,7 +81,7 @@ describe('new post should work', () => {
7581 { topicId : '5be41ae2a666dd00172d6072' }
7682 )
7783 expect ( isSuccess ( result ) ) . toBe ( true )
78- expect ( result . data . toast ) . toBe ( '发送成功 ')
84+ expect ( result . data . toast ) . a ( 'string ')
7985 expect ( result . data . data . id ) . a ( 'string' )
8086 id = result . data . data . id
8187 } )
@@ -87,14 +93,14 @@ describe('new post should work', () => {
8793 `测试评论${ Math . random ( ) } `
8894 )
8995 expect ( isSuccess ( result ) ) . toBe ( true )
90- expect ( result . data . toast ) . toBe ( '发送成功 ')
96+ expect ( result . data . toast ) . a ( 'string ')
9197 expect ( result . data . data . id ) . a ( 'string' )
9298 } )
9399
94100 it ( 'remove should work' , async ( ) => {
95101 const result = await api . posts . remove ( PostType . ORIGINAL , id )
96102 expect ( isSuccess ( result ) ) . toBe ( true )
97- expect ( result . data . toast ) . toBe ( '删除成功 ')
103+ expect ( result . data . toast ) . a ( 'string ')
98104 } )
99105
100106 it ( 'listLikedUsers should work' , async ( ) => {
0 commit comments