From 7477c5869848cbf727d293f4f923f8ab9eff1886 Mon Sep 17 00:00:00 2001 From: Abhishek Pandey Date: Fri, 26 Jan 2024 19:25:21 -0800 Subject: [PATCH] Fix failing unit test --- src/internal/m365/collection/groups/collection_test.go | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/internal/m365/collection/groups/collection_test.go b/src/internal/m365/collection/groups/collection_test.go index 4a4803ac9..96c2d462f 100644 --- a/src/internal/m365/collection/groups/collection_test.go +++ b/src/internal/m365/collection/groups/collection_test.go @@ -365,8 +365,8 @@ func (suite *CollectionUnitSuite) TestLazyFetchCollection_Conversations() { }, expectItemCount: 4, expectReads: []string{ - "fisher.data", - "flannigan.data", + "fisher", + "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 // 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() _, err := io.ReadAll(r)