@@ -56,28 +56,33 @@ func TestRenderConversation(t *testing.T) {
5656 }
5757 run ("diff with outdated" , func (t * testing.T , ctx * context.Context , resp * httptest.ResponseRecorder ) {
5858 ctx .Data ["ShowOutdatedComments" ] = true
59+ ctx .Data ["IsIssue" ] = true
5960 renderConversation (ctx , preparedComment , "diff" )
6061 assert .Contains (t , resp .Body .String (), `<div class="content comment-container"` )
6162 })
6263 run ("diff without outdated" , func (t * testing.T , ctx * context.Context , resp * httptest.ResponseRecorder ) {
6364 ctx .Data ["ShowOutdatedComments" ] = false
65+ ctx .Data ["IsIssue" ] = true
6466 renderConversation (ctx , preparedComment , "diff" )
6567 assert .Contains (t , resp .Body .String (), `conversation-not-existing` )
6668 })
6769 run ("timeline with outdated" , func (t * testing.T , ctx * context.Context , resp * httptest.ResponseRecorder ) {
6870 ctx .Data ["ShowOutdatedComments" ] = true
71+ ctx .Data ["IsIssue" ] = true
6972 renderConversation (ctx , preparedComment , "timeline" )
7073 assert .Contains (t , resp .Body .String (), `<div id="code-comments-` )
7174 })
7275 run ("timeline is not affected by ShowOutdatedComments=false" , func (t * testing.T , ctx * context.Context , resp * httptest.ResponseRecorder ) {
7376 ctx .Data ["ShowOutdatedComments" ] = false
77+ ctx .Data ["IsIssue" ] = true
7478 renderConversation (ctx , preparedComment , "timeline" )
7579 assert .Contains (t , resp .Body .String (), `<div id="code-comments-` )
7680 })
7781 run ("diff non-existing review" , func (t * testing.T , ctx * context.Context , resp * httptest.ResponseRecorder ) {
7882 err := db .TruncateBeans (db .DefaultContext , & issues_model.Review {})
7983 assert .NoError (t , err )
8084 ctx .Data ["ShowOutdatedComments" ] = true
85+ ctx .Data ["IsIssue" ] = true
8186 renderConversation (ctx , preparedComment , "diff" )
8287 assert .Equal (t , http .StatusOK , resp .Code )
8388 assert .NotContains (t , resp .Body .String (), `status-page-500` )
@@ -86,6 +91,7 @@ func TestRenderConversation(t *testing.T) {
8691 err := db .TruncateBeans (db .DefaultContext , & issues_model.Review {})
8792 assert .NoError (t , err )
8893 ctx .Data ["ShowOutdatedComments" ] = true
94+ ctx .Data ["IsIssue" ] = true
8995 renderConversation (ctx , preparedComment , "timeline" )
9096 assert .Equal (t , http .StatusOK , resp .Code )
9197 assert .NotContains (t , resp .Body .String (), `status-page-500` )
0 commit comments