feat: update profit sharing
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
package mappers
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"apskel-pos-be/internal/models"
|
||||
|
||||
"github.com/google/uuid"
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
|
||||
func TestCreateCategoryRequestToEntityDefaultsToTeam(t *testing.T) {
|
||||
notTeam := false
|
||||
|
||||
tests := []struct {
|
||||
name string
|
||||
isTeam *bool
|
||||
want bool
|
||||
}{
|
||||
{name: "omitted is a team", isTeam: nil, want: true},
|
||||
{name: "false is not a team", isTeam: ¬Team, want: false},
|
||||
}
|
||||
|
||||
for _, tt := range tests {
|
||||
t.Run(tt.name, func(t *testing.T) {
|
||||
entity := CreateCategoryRequestToEntity(&models.CreateCategoryRequest{
|
||||
OrganizationID: uuid.New(),
|
||||
Name: "Merchandise",
|
||||
IsTeam: tt.isTeam,
|
||||
})
|
||||
require.Equal(t, tt.want, entity.IsTeam)
|
||||
})
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user