make tests less sus (#3689)

#### Type of change

- [x] 🤖 Supportability/Tests

#### Test Plan

- [x]  Unit test
This commit is contained in:
Keepers 2023-06-27 16:16:13 -06:00 committed by GitHub
parent ce3ecacbe2
commit c7ce9f4c0e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -484,17 +484,17 @@ func (suite *GraphErrorsUnitSuite) TestGraphStack_labels() {
{ {
name: "mysite not found", name: "mysite not found",
err: odErrMsg("code", string(MysiteNotFound)), err: odErrMsg("code", string(MysiteNotFound)),
expect: []string{}, expect: []string{LabelsMysiteNotFound},
}, },
{ {
name: "mysite url not found", name: "mysite url not found",
err: odErrMsg("code", string(MysiteURLNotFound)), err: odErrMsg("code", string(MysiteURLNotFound)),
expect: []string{}, expect: []string{LabelsMysiteNotFound},
}, },
{ {
name: "no sp license", name: "no sp license",
err: odErrMsg("code", string(NoSPLicense)), err: odErrMsg("code", string(NoSPLicense)),
expect: []string{}, expect: []string{LabelsNoSharePointLicense},
}, },
} }
for _, test := range table { for _, test := range table {
@ -509,6 +509,11 @@ func (suite *GraphErrorsUnitSuite) TestGraphStack_labels() {
for _, e := range test.expect { for _, e := range test.expect {
assert.True(t, clues.HasLabel(result, e), clues.ToCore(result)) 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")
}) })
} }
} }