summaryrefslogtreecommitdiff
path: root/internal/commands/in_test.go
diff options
context:
space:
mode:
authorT <t@tjp.lol>2025-08-13 13:12:41 -0600
committerT <t@tjp.lol>2025-08-13 13:13:48 -0600
commit29c6581e08d0fe98433eff218de7701b51a6861c (patch)
treea8c712a20dcc161528a0fa5099f39eb65244760c /internal/commands/in_test.go
parentaceb81114f4df7d6bd9ff2af19ab7d51d202b6a3 (diff)
fix time entry rate override behavior and add tests
Diffstat (limited to 'internal/commands/in_test.go')
-rw-r--r--internal/commands/in_test.go12
1 files changed, 6 insertions, 6 deletions
diff --git a/internal/commands/in_test.go b/internal/commands/in_test.go
index 884a459..eac70a2 100644
--- a/internal/commands/in_test.go
+++ b/internal/commands/in_test.go
@@ -384,7 +384,7 @@ func TestInCommandBillableRateStorage(t *testing.T) {
expectedRate: func() *int64 { f := int64(20050); return &f }(), // $200.50
},
{
- name: "no explicit rate uses project rate",
+ name: "no explicit rate results in NULL (even with project rate)",
setupData: func(q *queries.Queries) (int64, int64) {
client, _ := q.CreateClient(context.Background(), queries.CreateClientParams{
Name: "TestClient",
@@ -398,11 +398,11 @@ func TestInCommandBillableRateStorage(t *testing.T) {
})
return client.ID, project.ID
},
- args: []string{"in", "-c", "TestClient", "-p", "ProjectWithRate"},
- expectedRate: func() *int64 { f := int64(12500); return &f }(), // $125.00
+ args: []string{"in", "-c", "TestClient", "-p", "ProjectWithRate"},
+ expectExplicitNil: true, // NULL because no explicit rate override
},
{
- name: "no explicit rate and no project uses client rate",
+ name: "no explicit rate results in NULL (even with client rate)",
setupData: func(q *queries.Queries) (int64, int64) {
client, _ := q.CreateClient(context.Background(), queries.CreateClientParams{
Name: "ClientOnly",
@@ -411,8 +411,8 @@ func TestInCommandBillableRateStorage(t *testing.T) {
})
return client.ID, 0
},
- args: []string{"in", "-c", "ClientOnly"},
- expectedRate: func() *int64 { f := int64(9000); return &f }(), // $90.00
+ args: []string{"in", "-c", "ClientOnly"},
+ expectExplicitNil: true, // NULL because no explicit rate override
},
{
name: "no rates anywhere results in NULL",