Merged in feature/checkbox (pull request #145)

Checkbox Primary Edge Cases

* hascheckboxlogic

* gen

* preppinggen

* exploringcheckbox

* removeunselected

* tests

* failingtest

* failintests

* nomockqueryapi

* db

* name

* nocontainer

* deleterow

* cnc

* extradocsandupdatetextracts

* moretables

* appndedtables

* baseversion
This commit is contained in:
Michael McGuinness
2025-05-20 12:47:22 +00:00
parent beb221937b
commit 61d12bf8df
69 changed files with 223611 additions and 78482 deletions
+34 -36
View File
@@ -44,44 +44,42 @@ func TestQueryRunner(t *testing.T) {
Sync: svc,
})
t.Run("valid", func(t *testing.T) {
doc := queryversionsyncrunner.Body{
QueryID: uuid.New(),
}
doc := queryversionsyncrunner.Body{
QueryID: uuid.New(),
}
clientOne := "hello"
clientTwo := "bye"
clientIds := []string{
clientOne,
clientTwo,
}
clientOne := "hello"
clientTwo := "bye"
clientIds := []string{
clientOne,
clientTwo,
}
pool.ExpectQuery("name: ListQueryClientIDs :many").WithArgs(&doc.QueryID).
WillReturnRows(
pgxmock.NewRows([]string{"clientId"}).
AddRow(clientOne).
AddRow(clientTwo),
)
pool.ExpectQuery("name: ListQueryClientIDs :many").WithArgs(&doc.QueryID).
WillReturnRows(
pgxmock.NewRows([]string{"clientId"}).
AddRow(clientOne).
AddRow(clientTwo),
)
mockSQS.EXPECT().
SendMessage(
mock.Anything,
mock.MatchedBy(func(in *sqs.SendMessageInput) bool {
return *in.QueueUrl == cfg.ClientSyncURL && *in.MessageBody == fmt.Sprintf("{\"id\":\"%s\"}", clientIds[0])
}),
mock.Anything,
).
Return(&sqs.SendMessageOutput{}, nil)
mockSQS.EXPECT().
SendMessage(
mock.Anything,
mock.MatchedBy(func(in *sqs.SendMessageInput) bool {
return *in.QueueUrl == cfg.ClientSyncURL && *in.MessageBody == fmt.Sprintf("{\"id\":\"%s\"}", clientIds[1])
}),
mock.Anything,
).
Return(&sqs.SendMessageOutput{}, nil)
mockSQS.EXPECT().
SendMessage(
mock.Anything,
mock.MatchedBy(func(in *sqs.SendMessageInput) bool {
return *in.QueueUrl == cfg.ClientSyncURL && *in.MessageBody == fmt.Sprintf("{\"id\":\"%s\"}", clientIds[0])
}),
mock.Anything,
).
Return(&sqs.SendMessageOutput{}, nil)
mockSQS.EXPECT().
SendMessage(
mock.Anything,
mock.MatchedBy(func(in *sqs.SendMessageInput) bool {
return *in.QueueUrl == cfg.ClientSyncURL && *in.MessageBody == fmt.Sprintf("{\"id\":\"%s\"}", clientIds[1])
}),
mock.Anything,
).
Return(&sqs.SendMessageOutput{}, nil)
assert.True(t, runner.Process(ctx, doc))
})
assert.True(t, runner.Process(ctx, doc))
}