aboutsummaryrefslogtreecommitdiffstats
path: root/bug/op_edit_comment_test.go
diff options
context:
space:
mode:
authorMichael Muré <batolettre@gmail.com>2021-04-18 20:37:47 +0200
committerGitHub <noreply@github.com>2021-04-18 20:37:47 +0200
commit24155156223595e48f215e87cf9ce7895e22f4a7 (patch)
tree84bb7a57e62f376068241bf911fa43b3694a1eb1 /bug/op_edit_comment_test.go
parent718aa5f6e382b9c09caf866215358238ce6b5004 (diff)
parent6a5ffd94e0c7a2b9373981f99c4798eda601f4da (diff)
downloadgit-bug-24155156223595e48f215e87cf9ce7895e22f4a7.tar.gz
Merge pull request #631 from MichaelMure/comment-edit
Fix ID string in order to find correct bug instance on comment edit operation
Diffstat (limited to 'bug/op_edit_comment_test.go')
-rw-r--r--bug/op_edit_comment_test.go15
1 files changed, 6 insertions, 9 deletions
diff --git a/bug/op_edit_comment_test.go b/bug/op_edit_comment_test.go
index 777f5f87..5ba94706 100644
--- a/bug/op_edit_comment_test.go
+++ b/bug/op_edit_comment_test.go
@@ -24,14 +24,12 @@ func TestEdit(t *testing.T) {
create := NewCreateOp(rene, unix, "title", "create", nil)
create.Apply(&snapshot)
- id1 := create.Id()
- require.NoError(t, id1.Validate())
+ require.NoError(t, create.Id().Validate())
comment1 := NewAddCommentOp(rene, unix, "comment 1", nil)
comment1.Apply(&snapshot)
- id2 := comment1.Id()
- require.NoError(t, id2.Validate())
+ require.NoError(t, comment1.Id().Validate())
// add another unrelated op in between
setTitle := NewSetTitleOp(rene, unix, "edited title", "title")
@@ -40,10 +38,9 @@ func TestEdit(t *testing.T) {
comment2 := NewAddCommentOp(rene, unix, "comment 2", nil)
comment2.Apply(&snapshot)
- id3 := comment2.Id()
- require.NoError(t, id3.Validate())
+ require.NoError(t, comment2.Id().Validate())
- edit := NewEditCommentOp(rene, unix, snapshot.Comments[0].Id(), "create edited", nil)
+ edit := NewEditCommentOp(rene, unix, create.Id(), "create edited", nil)
edit.Apply(&snapshot)
require.Len(t, snapshot.Timeline, 4)
@@ -54,7 +51,7 @@ func TestEdit(t *testing.T) {
require.Equal(t, snapshot.Comments[1].Message, "comment 1")
require.Equal(t, snapshot.Comments[2].Message, "comment 2")
- edit2 := NewEditCommentOp(rene, unix, snapshot.Comments[1].Id(), "comment 1 edited", nil)
+ edit2 := NewEditCommentOp(rene, unix, comment1.Id(), "comment 1 edited", nil)
edit2.Apply(&snapshot)
require.Len(t, snapshot.Timeline, 4)
@@ -65,7 +62,7 @@ func TestEdit(t *testing.T) {
require.Equal(t, snapshot.Comments[1].Message, "comment 1 edited")
require.Equal(t, snapshot.Comments[2].Message, "comment 2")
- edit3 := NewEditCommentOp(rene, unix, snapshot.Comments[2].Id(), "comment 2 edited", nil)
+ edit3 := NewEditCommentOp(rene, unix, comment2.Id(), "comment 2 edited", nil)
edit3.Apply(&snapshot)
require.Len(t, snapshot.Timeline, 4)