Skip to content

Commit

Permalink
PR FIXUP - Remove dockey hardcoding
Browse files Browse the repository at this point in the history
  • Loading branch information
AndrewSisley committed Dec 14, 2022
1 parent af23726 commit 9fb11e5
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 6 deletions.
7 changes: 5 additions & 2 deletions tests/integration/events/simple/with_create_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ func TestEventsSimpleWithCreate(t *testing.T) {
),
)
assert.Nil(t, err)
docKey1 := doc1.Key().String()

doc2, err := client.NewDocFromJSON(
[]byte(
`{
Expand All @@ -38,6 +40,7 @@ func TestEventsSimpleWithCreate(t *testing.T) {
),
)
assert.Nil(t, err)
docKey2 := doc2.Key().String()

test := testUtils.TestCase{
CollectionCalls: map[string][]func(client.Collection){
Expand All @@ -54,10 +57,10 @@ func TestEventsSimpleWithCreate(t *testing.T) {
},
ExpectedUpdates: []testUtils.ExpectedUpdate{
{
DocKey: immutable.Some("bae-43deba43-f2bc-59f4-9056-fef661b22832"),
DocKey: immutable.Some(docKey1),
},
{
DocKey: immutable.Some("bae-359dfe55-77a4-59de-a687-fc5049dc61fe"),
DocKey: immutable.Some(docKey2),
},
},
}
Expand Down
3 changes: 2 additions & 1 deletion tests/integration/events/simple/with_delete_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ func TestEventsSimpleWithDelete(t *testing.T) {
),
)
assert.Nil(t, err)
docKey1 := doc1.Key().String()

test := testUtils.TestCase{
CollectionCalls: map[string][]func(client.Collection){
Expand All @@ -49,7 +50,7 @@ func TestEventsSimpleWithDelete(t *testing.T) {
},
ExpectedUpdates: []testUtils.ExpectedUpdate{
{
DocKey: immutable.Some("bae-43deba43-f2bc-59f4-9056-fef661b22832"),
DocKey: immutable.Some(docKey1),
},
// No update to reflect the delete
},
Expand Down
9 changes: 6 additions & 3 deletions tests/integration/events/simple/with_update_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ func TestEventsSimpleWithUpdate(t *testing.T) {
),
)
assert.Nil(t, err)
docKey1 := doc1.Key().String()

doc2, err := client.NewDocFromJSON(
[]byte(
`{
Expand All @@ -38,6 +40,7 @@ func TestEventsSimpleWithUpdate(t *testing.T) {
),
)
assert.Nil(t, err)
docKey2 := doc2.Key().String()

test := testUtils.TestCase{
CollectionCalls: map[string][]func(client.Collection){
Expand All @@ -60,14 +63,14 @@ func TestEventsSimpleWithUpdate(t *testing.T) {
},
ExpectedUpdates: []testUtils.ExpectedUpdate{
{
DocKey: immutable.Some("bae-43deba43-f2bc-59f4-9056-fef661b22832"),
DocKey: immutable.Some(docKey1),
Cid: immutable.Some("bafybeihm4gewwhzsyqs7tuazdsbusp6pm3oinhnj2ae6funcwshwpxuxri"),
},
{
DocKey: immutable.Some("bae-359dfe55-77a4-59de-a687-fc5049dc61fe"),
DocKey: immutable.Some(docKey2),
},
{
DocKey: immutable.Some("bae-43deba43-f2bc-59f4-9056-fef661b22832"),
DocKey: immutable.Some(docKey1),
Cid: immutable.Some("bafybeicxo5sqjzi2mjputtbzwnkliickvowwfigyzziibtwlj7xe3ca7ly"),
},
},
Expand Down

0 comments on commit 9fb11e5

Please sign in to comment.