mirror of
https://github.com/BookStackApp/BookStack.git
synced 2024-11-22 13:31:49 +08:00
Comments: Added visual nesting limit, added nesting test
This commit is contained in:
parent
3b46b92bb9
commit
3bede42121
|
@ -663,6 +663,12 @@ body.flexbox-support #entity-selector-wrap .popup-body .form-group {
|
|||
}
|
||||
}
|
||||
|
||||
.comments-container {
|
||||
padding-inline: $-xl;
|
||||
@include smaller-than($m) {
|
||||
padding-inline: $-xs;
|
||||
}
|
||||
}
|
||||
.comment-box {
|
||||
border-radius: 4px;
|
||||
border: 1px solid #DDD;
|
||||
|
@ -715,6 +721,10 @@ body.flexbox-support #entity-selector-wrap .popup-body .form-group {
|
|||
height: calc(100% - $-m);
|
||||
}
|
||||
|
||||
.comment-branch .comment-branch .comment-branch .comment-branch .comment-thread-indicator {
|
||||
display: none;
|
||||
}
|
||||
|
||||
#tag-manager .drag-card {
|
||||
max-width: 500px;
|
||||
}
|
||||
|
|
|
@ -34,7 +34,7 @@
|
|||
</div>
|
||||
@endif
|
||||
|
||||
<div class="px-xl comments-container mb-l print-hidden">
|
||||
<div class="comments-container mb-l print-hidden">
|
||||
@include('comments.comments', ['commentTree' => $commentTree, 'page' => $page])
|
||||
<div class="clearfix"></div>
|
||||
</div>
|
||||
|
|
|
@ -114,4 +114,25 @@ class CommentTest extends TestCase
|
|||
$pageView->assertDontSee($script, false);
|
||||
$pageView->assertSee('sometextinthecommentupdated');
|
||||
}
|
||||
|
||||
public function test_reply_comments_are_nested()
|
||||
{
|
||||
$this->asAdmin();
|
||||
$page = $this->entities->page();
|
||||
|
||||
$this->postJson("/comment/$page->id", ['text' => 'My new comment']);
|
||||
$this->postJson("/comment/$page->id", ['text' => 'My new comment']);
|
||||
|
||||
$respHtml = $this->withHtml($this->get($page->getUrl()));
|
||||
$respHtml->assertElementCount('.comment-branch', 3);
|
||||
$respHtml->assertElementNotExists('.comment-branch .comment-branch');
|
||||
|
||||
$comment = $page->comments()->first();
|
||||
$resp = $this->postJson("/comment/$page->id", ['text' => 'My nested comment', 'parent_id' => $comment->local_id]);
|
||||
$resp->assertStatus(200);
|
||||
|
||||
$respHtml = $this->withHtml($this->get($page->getUrl()));
|
||||
$respHtml->assertElementCount('.comment-branch', 4);
|
||||
$respHtml->assertElementContains('.comment-branch .comment-branch', 'My nested comment');
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user