From c7ce9f4c0ed9cf3433e7371dd2bedac185d5b131 Mon Sep 17 00:00:00 2001 From: Keepers Date: Tue, 27 Jun 2023 16:16:13 -0600 Subject: [PATCH] make tests less sus (#3689) #### Type of change - [x] :robot: Supportability/Tests #### Test Plan - [x] :zap: Unit test --- src/internal/m365/graph/errors_test.go | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/internal/m365/graph/errors_test.go b/src/internal/m365/graph/errors_test.go index ffc1b85d6..c291c8b8e 100644 --- a/src/internal/m365/graph/errors_test.go +++ b/src/internal/m365/graph/errors_test.go @@ -484,17 +484,17 @@ func (suite *GraphErrorsUnitSuite) TestGraphStack_labels() { { name: "mysite not found", err: odErrMsg("code", string(MysiteNotFound)), - expect: []string{}, + expect: []string{LabelsMysiteNotFound}, }, { name: "mysite url not found", err: odErrMsg("code", string(MysiteURLNotFound)), - expect: []string{}, + expect: []string{LabelsMysiteNotFound}, }, { name: "no sp license", err: odErrMsg("code", string(NoSPLicense)), - expect: []string{}, + expect: []string{LabelsNoSharePointLicense}, }, } for _, test := range table { @@ -509,6 +509,11 @@ func (suite *GraphErrorsUnitSuite) TestGraphStack_labels() { for _, e := range test.expect { assert.True(t, clues.HasLabel(result, e), clues.ToCore(result)) } + + labels := clues.Labels(result) + assert.Equal(t, + len(test.expect), len(labels), + "result should have as many labels as expected") }) } }