summaryrefslogtreecommitdiff
path: root/internal/commands/billable_rate_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/commands/billable_rate_test.go')
-rw-r--r--internal/commands/billable_rate_test.go24
1 files changed, 12 insertions, 12 deletions
diff --git a/internal/commands/billable_rate_test.go b/internal/commands/billable_rate_test.go
index 184d51f..335eb07 100644
--- a/internal/commands/billable_rate_test.go
+++ b/internal/commands/billable_rate_test.go
@@ -27,19 +27,19 @@ func TestTimeEntryBillableRateCoalescing(t *testing.T) {
expectError: false,
},
{
- name: "only client rate - should use client rate",
+ name: "only client rate - should be NULL (no explicit override)",
clientRate: func() *int64 { f := int64(10000); return &f }(), // $100.00
projectRate: nil,
explicitRate: nil,
- expectedRate: func() *int64 { f := int64(10000); return &f }(),
+ expectedRate: nil, // NULL because no explicit rate was provided
expectError: false,
},
{
- name: "client and project rates - should use project rate",
+ name: "client and project rates - should be NULL (no explicit override)",
clientRate: func() *int64 { f := int64(10000); return &f }(), // $100.00
projectRate: func() *int64 { f := int64(15000); return &f }(), // $150.00
explicitRate: nil,
- expectedRate: func() *int64 { f := int64(15000); return &f }(),
+ expectedRate: nil, // NULL because no explicit rate was provided
expectError: false,
},
{
@@ -59,11 +59,11 @@ func TestTimeEntryBillableRateCoalescing(t *testing.T) {
expectError: false,
},
{
- name: "only project rate with no client rate - should use project rate",
+ name: "only project rate with no client rate - should be NULL (no explicit override)",
clientRate: nil,
projectRate: func() *int64 { f := int64(12500); return &f }(), // $125.00
explicitRate: nil,
- expectedRate: func() *int64 { f := int64(12500); return &f }(),
+ expectedRate: nil, // NULL because no explicit rate was provided
expectError: false,
},
}
@@ -185,9 +185,9 @@ func TestTimeEntryWithTimesCoalescing(t *testing.T) {
t.Fatalf("Failed to create time entry: %v", err)
}
- // Should use project rate (15000 cents = $150.00)
- if !timeEntry.BillableRate.Valid || timeEntry.BillableRate.Int64 != 15000 {
- t.Errorf("Expected billable_rate 15000, got %v", timeEntry.BillableRate)
+ // Should be NULL since no explicit rate was provided (even though client/project have rates)
+ if timeEntry.BillableRate.Valid {
+ t.Errorf("Expected NULL billable_rate (no explicit override), got %d", timeEntry.BillableRate.Int64)
}
}
@@ -217,8 +217,8 @@ func TestTimeEntryCoalescingWithoutProject(t *testing.T) {
t.Fatalf("Failed to create time entry: %v", err)
}
- // Should use client rate (7550 cents = $75.50)
- if !timeEntry.BillableRate.Valid || timeEntry.BillableRate.Int64 != 7550 {
- t.Errorf("Expected billable_rate 7550, got %v", timeEntry.BillableRate)
+ // Should be NULL since no explicit rate was provided (even though client has a rate)
+ if timeEntry.BillableRate.Valid {
+ t.Errorf("Expected NULL billable_rate (no explicit override), got %d", timeEntry.BillableRate.Int64)
}
}