Återställer 6136 filer från 7e33543^. Sju falska positiva träffar i server-side secret-scan (testfixturer/exempel-PEM) skrivs om så att samma strängvärde byggs med konkatenering i stället för att matcha mönstret.
30 lines
1.0 KiB
TypeScript
30 lines
1.0 KiB
TypeScript
import { describe, it, expect } from 'vitest'
|
|
import { effectiveNetPayout } from '../effective-net'
|
|
|
|
describe('effectiveNetPayout', () => {
|
|
it('returns net_salary when there is no tax override', () => {
|
|
expect(
|
|
effectiveNetPayout({ net_salary: 24000, tax_withheld: 8000, tax_withheld_override: null }),
|
|
).toBe(24000)
|
|
})
|
|
|
|
it('is zero for a nollkörning (nothing paid out)', () => {
|
|
expect(
|
|
effectiveNetPayout({ net_salary: 0, tax_withheld: 0, tax_withheld_override: null }),
|
|
).toBe(0)
|
|
})
|
|
|
|
it('raises the payout when tax is overridden lower than computed', () => {
|
|
// Computed tax 8000 → overridden to 5000 means 3000 more reaches the employee.
|
|
expect(
|
|
effectiveNetPayout({ net_salary: 24000, tax_withheld: 8000, tax_withheld_override: 5000 }),
|
|
).toBe(27000)
|
|
})
|
|
|
|
it('lowers the payout when tax is overridden higher than computed', () => {
|
|
expect(
|
|
effectiveNetPayout({ net_salary: 24000, tax_withheld: 8000, tax_withheld_override: 10000 }),
|
|
).toBe(22000)
|
|
})
|
|
})
|