Skip to content

Commit

Permalink
WIP - Convert handful of tests
Browse files Browse the repository at this point in the history
  • Loading branch information
AndrewSisley committed Oct 24, 2024
1 parent ecf5a34 commit 3c475c2
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 13 deletions.
26 changes: 13 additions & 13 deletions tests/integration/query/commits/simple_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,13 @@ func TestQueryCommits(t *testing.T) {
Results: map[string]any{
"commits": []map[string]any{
{
"cid": "bafyreif6dqbkr7t37jcjfxxrjnxt7cspxzvs7qwlbtjca57cc663he4s7e",
"cid": testUtils.NewUniqueCid("name"),
},
{
"cid": "bafyreigtnj6ntulcilkmin4pgukjwv3nwglqpiiyddz3dyfexdbltze7sy",
"cid": testUtils.NewUniqueCid("age"),
},
{
"cid": "bafyreia2vlbfkcbyogdjzmbqcjneabwwwtw7ti2xbd7yor5mbu2sk4pcoy",
"cid": testUtils.NewUniqueCid("head"),
},
},
},
Expand Down Expand Up @@ -364,7 +364,7 @@ func TestQuery_CommitsWithAllFieldsWithUpdate_NoError(t *testing.T) {
Results: map[string]any{
"commits": []map[string]any{
{
"cid": "bafyreih5h6i6ohfsgrcjtg76iarebqcurpaft73gpobl2z2cfsvihsgdqu",
"cid": testUtils.NewUniqueCid("age update"),
"collectionID": int64(1),
"delta": testUtils.CBORValue(22),
"docID": "bae-c9fb0fa4-1195-589c-aa54-e68333fb90b3",
Expand All @@ -373,13 +373,13 @@ func TestQuery_CommitsWithAllFieldsWithUpdate_NoError(t *testing.T) {
"height": int64(2),
"links": []map[string]any{
{
"cid": "bafyreif6dqbkr7t37jcjfxxrjnxt7cspxzvs7qwlbtjca57cc663he4s7e",
"cid": testUtils.NewUniqueCid("age create"),
"name": "_head",
},
},
},
{
"cid": "bafyreif6dqbkr7t37jcjfxxrjnxt7cspxzvs7qwlbtjca57cc663he4s7e",
"cid": testUtils.NewUniqueCid("age create"),
"collectionID": int64(1),
"delta": testUtils.CBORValue(21),
"docID": "bae-c9fb0fa4-1195-589c-aa54-e68333fb90b3",
Expand All @@ -389,7 +389,7 @@ func TestQuery_CommitsWithAllFieldsWithUpdate_NoError(t *testing.T) {
"links": []map[string]any{},
},
{
"cid": "bafyreigtnj6ntulcilkmin4pgukjwv3nwglqpiiyddz3dyfexdbltze7sy",
"cid": testUtils.NewUniqueCid("name create"),
"collectionID": int64(1),
"delta": testUtils.CBORValue("John"),
"docID": "bae-c9fb0fa4-1195-589c-aa54-e68333fb90b3",
Expand All @@ -399,7 +399,7 @@ func TestQuery_CommitsWithAllFieldsWithUpdate_NoError(t *testing.T) {
"links": []map[string]any{},
},
{
"cid": "bafyreiale6qsjc7qewod3c6h2odwamfwcf7vt4zlqtw7ldcm57xdkgxja4",
"cid": testUtils.NewUniqueCid("update composite"),
"collectionID": int64(1),
"delta": nil,
"docID": "bae-c9fb0fa4-1195-589c-aa54-e68333fb90b3",
Expand All @@ -408,17 +408,17 @@ func TestQuery_CommitsWithAllFieldsWithUpdate_NoError(t *testing.T) {
"height": int64(2),
"links": []map[string]any{
{
"cid": "bafyreia2vlbfkcbyogdjzmbqcjneabwwwtw7ti2xbd7yor5mbu2sk4pcoy",
"cid": testUtils.NewUniqueCid("create composite"),
"name": "_head",
},
{
"cid": "bafyreih5h6i6ohfsgrcjtg76iarebqcurpaft73gpobl2z2cfsvihsgdqu",
"cid": testUtils.NewUniqueCid("age update"),
"name": "age",
},
},
},
{
"cid": "bafyreia2vlbfkcbyogdjzmbqcjneabwwwtw7ti2xbd7yor5mbu2sk4pcoy",
"cid": testUtils.NewUniqueCid("create composite"),
"collectionID": int64(1),
"delta": nil,
"docID": "bae-c9fb0fa4-1195-589c-aa54-e68333fb90b3",
Expand All @@ -427,11 +427,11 @@ func TestQuery_CommitsWithAllFieldsWithUpdate_NoError(t *testing.T) {
"height": int64(1),
"links": []map[string]any{
{
"cid": "bafyreif6dqbkr7t37jcjfxxrjnxt7cspxzvs7qwlbtjca57cc663he4s7e",
"cid": testUtils.NewUniqueCid("age create"),
"name": "age",
},
{
"cid": "bafyreigtnj6ntulcilkmin4pgukjwv3nwglqpiiyddz3dyfexdbltze7sy",
"cid": testUtils.NewUniqueCid("name create"),
"name": "name",
},
},
Expand Down
7 changes: 7 additions & 0 deletions tests/integration/query/commits/with_delete_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,10 @@ func TestQueryCommits_AfterDocDeletion_ShouldStillFetch(t *testing.T) {
Request: `
query {
commits(fieldId: "C") {
cid
fieldName
links {
cid
name
}
}
Expand All @@ -50,20 +52,25 @@ func TestQueryCommits_AfterDocDeletion_ShouldStillFetch(t *testing.T) {
Results: map[string]any{
"commits": []map[string]any{
{
"cid": testUtils.NewUniqueCid("delete"),
"fieldName": nil,
"links": []map[string]any{
{
"cid": testUtils.NewUniqueCid("create composite"),
"name": "_head",
},
},
},
{
"cid": testUtils.NewUniqueCid("create composite"),
"fieldName": nil,
"links": []map[string]any{
{
"cid": testUtils.NewUniqueCid("create age"),
"name": "age",
},
{
"cid": testUtils.NewUniqueCid("create name"),
"name": "name",
},
},
Expand Down

0 comments on commit 3c475c2

Please sign in to comment.