Implement Form.person() on fed2019 forms.
[ustaxlib.git] / src / fed2019 / Form8606.test.ts
1 import { Person } from '../core';
2
3 import Form1040, { FilingStatus } from './Form1040';
4 import Form8606 from './Form8606';
5 import TaxReturn from './TaxReturn';
6
7 test('skip part 1', () => {
8 const p = Person.self('A');
9 const tr = new TaxReturn();
10 tr.addPerson(p);
11 const f = new Form8606({
12 person: p,
13 nondeductibleContributions: 6000,
14 traditionalIraBasis: 0,
15 distributionFromTradSepOrSimpleIraOrMadeRothConversion: false
16 });
17 tr.addForm(f);
18
19 expect(f.getValue(tr, '14')).toBe(6000);
20 });
21
22 test('Roth conversion no basis', () => {
23 const p = Person.self('A');
24 const tr = new TaxReturn();
25 tr.addPerson(p);
26 const f = new Form8606({
27 person: p,
28 nondeductibleContributions: 6000,
29 traditionalIraBasis: 0,
30 distributionFromTradSepOrSimpleIraOrMadeRothConversion: true,
31 contributionsMadeInCurrentYear: 0,
32 valueOfAllTradSepSimpleIras: 0,
33 distributionsFromAllTradSepSimpleIras: 0,
34 amountConvertedFromTradSepSimpleToRoth: 6000,
35 });
36 tr.addForm(f);
37
38 expect(f.getValue(tr, '9')).toBe(6000);
39 expect(f.getValue(tr, '13')).toBe(6000);
40 expect(f.getValue(tr, '14')).toBe(0);
41 expect(f.getValue(tr, '15c')).toBe(0);
42 expect(f.getValue(tr, '16')).toBe(6000);
43 expect(f.getValue(tr, '17')).toBe(6000);
44 expect(f.getValue(tr, '18')).toBe(0);
45 });