Skip to content

Commit

Permalink
adding unit test for AutoClip
Browse files Browse the repository at this point in the history
  • Loading branch information
Yolan Romailler authored and dominikschulz committed Mar 9, 2018
1 parent 081af2f commit 1771e28
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions utils/ctxutil/ctxutil_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,14 @@ func TestEditRecipients(t *testing.T) {
assert.Equal(t, false, IsEditRecipients(WithEditRecipients(ctx, false)))
}

func TestAutoClip(t *testing.T) {
ctx := context.Background()

assert.Equal(t, true, IsAutoClip(ctx))
assert.Equal(t, true, IsAutoClip(WithAutoClip(ctx, true)))
assert.Equal(t, false, IsAutoClip(WithAutoClip(ctx, false)))
}

func TestComposite(t *testing.T) {
ctx := context.Background()
ctx = WithDebug(ctx, true)
Expand All @@ -170,6 +178,7 @@ func TestComposite(t *testing.T) {
ctx = WithVerbose(ctx, true)
ctx = WithNotifications(ctx, true)
ctx = WithEditRecipients(ctx, true)
ctx = WithAutoClip(ctx, true)

assert.Equal(t, true, IsDebug(ctx))
assert.Equal(t, true, HasDebug(ctx))
Expand Down Expand Up @@ -224,4 +233,7 @@ func TestComposite(t *testing.T) {

assert.Equal(t, true, IsEditRecipients(ctx))
assert.Equal(t, true, HasEditRecipients(ctx))

assert.Equal(t, true, IsAutoClip(ctx))
assert.Equal(t, true, HasAutoClip(ctx))
}

0 comments on commit 1771e28

Please sign in to comment.