Skip to content

Commit

Permalink
πŸ”„ Sync from monorepo
Browse files Browse the repository at this point in the history
  • Loading branch information
mojo-machine[bot] committed Jun 13, 2024
1 parent e69b599 commit 5876ed1
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion lib/sanityref/sanityref_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"context"
_ "embed"
"encoding/json"
"slices"
"testing"

"github.com/matryer/is"
Expand Down Expand Up @@ -284,5 +285,13 @@ func TestResolveReferencesStrictMissingImagesReject(t *testing.T) {
err2, ok := gerrors.As[merr.E](err)
is.True(ok)
is.Equal(err2.Code, ErrReferencedDocumentMissing)
is.Equal(err2.Meta, merr.M{"missing_ids": []string{"image-id2", "image-id4"}})
is.Equal(len(err2.Meta), 1)

missingIDs, ok := err2.Meta["missing_ids"].([]string)
is.True(ok)

missingIDs = slices.Clone(missingIDs)
slices.Sort(missingIDs)

is.Equal(missingIDs, []string{"image-id2", "image-id4"})
}

0 comments on commit 5876ed1

Please sign in to comment.