summaryrefslogtreecommitdiff
path: root/app/domain/entity_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'app/domain/entity_test.go')
-rw-r--r--app/domain/entity_test.go17
1 files changed, 1 insertions, 16 deletions
diff --git a/app/domain/entity_test.go b/app/domain/entity_test.go
index 3f4c788..1ac1d26 100644
--- a/app/domain/entity_test.go
+++ b/app/domain/entity_test.go
@@ -5,7 +5,6 @@ import (
"testing"
"github.com/stretchr/testify/assert"
- "github.com/stretchr/testify/require"
"github.com/xlgmokha/x/pkg/x"
)
@@ -30,26 +29,12 @@ func TestEntity(t *testing.T) {
assert.Equal(t, id, example.GetID())
})
-
})
t.Run("ToGID", func(t *testing.T) {
example := x.New[*example](WithULID[*example]())
gid := example.ToGID()
- assert.Equal(t, fmt.Sprintf("gid://sparkle/Entity/%s", example.ID), gid)
- })
-
- t.Run("ToObjectReference", func(t *testing.T) {
- t.Run("returns a valid object reference", func(t *testing.T) {
- example := x.New[*example](WithULID[*example]())
- reference := example.ToObjectReference()
-
- require.NotNil(t, reference)
- require.NoError(t, reference.Validate())
- require.NoError(t, reference.ValidateAll())
- assert.Equal(t, example.ID.String(), reference.GetObjectId())
- assert.Equal(t, "entity", reference.GetObjectType())
- })
+ assert.Equal(t, fmt.Sprintf("gid://sparkle/Entity/%s", example.ID), gid.String())
})
}