Fix failing unit test

This commit is contained in:
Abhishek Pandey 2024-01-26 19:25:21 -08:00
parent deaf8dcd95
commit 7477c58698

View File

@ -365,8 +365,8 @@ func (suite *CollectionUnitSuite) TestLazyFetchCollection_Conversations() {
}, },
expectItemCount: 4, expectItemCount: 4,
expectReads: []string{ expectReads: []string{
"fisher.data", "fisher",
"flannigan.data", "flannigan",
}, },
}, },
{ {
@ -462,7 +462,10 @@ func (suite *CollectionUnitSuite) TestLazyFetchCollection_Conversations() {
// Check if the test wants us to read the item's data so the lazy // Check if the test wants us to read the item's data so the lazy
// data fetch is executed. // data fetch is executed.
if slices.Contains(test.expectReads, item.ID()) { //
// Inspect with trimmedID since getItem() operates on ID, not the file
if strings.HasSuffix(item.ID(), ".data") &&
slices.Contains(test.expectReads, trimmedID) {
r := item.ToReader() r := item.ToReader()
_, err := io.ReadAll(r) _, err := io.ReadAll(r)