Use the computations from Form 8959 on Schedule 2.
[ustaxlib.git] / src / fed2019 / Form1040.test.ts
1 import Person from '../Person';
2 import TaxReturn from '../TaxReturn';
3
4 import Form1040, { FilingStatus, Schedule2 } from './Form1040';
5 import Form1099DIV from './Form1099DIV';
6 import Form1099INT from './Form1099INT';
7 import Form8959 from './Form8959';
8 import FormW2 from './FormW2';
9
10 test('w2 wages', () => {
11 const pa = Person.self('A');
12 const pb = Person.spouse('B');
13 const tr = new TaxReturn(2019);
14 tr.addForm(new FormW2({
15 employer: 'AA',
16 employee: pa,
17 wages: 1000000.00,
18 fedIncomeTax: 0,
19 medicareWages: 0,
20 }));
21 tr.addForm(new FormW2({
22 employer: 'BB',
23 employee: pb,
24 wages: 36.32,
25 fedIncomeTax: 0,
26 medicareWages: 0,
27 }));
28 const f1040 = new Form1040({ filingStatus: FilingStatus.MarriedFilingJoint });
29 tr.addForm(f1040);
30 tr.addForm(new Schedule2);
31 tr.addForm(new Form8959);
32 expect(f1040.getValue(tr, '1')).toBe(1000036.32);
33 f1040.getValue(tr, '23');
34 });
35
36 test('interest income', () => {
37 const p = Person.self('A');
38 const tr = new TaxReturn(2019);
39 tr.addForm(new Form1099INT({
40 payer: 'Bank',
41 payee: p,
42 interest: 100,
43 taxExemptInterest: 0
44 }));
45 tr.addForm(new Form1099INT({
46 payer: 'Bank 2',
47 payee: p,
48 interest: 3.50,
49 taxExemptInterest: 95
50 }));
51
52 const f1040 = new Form1040();
53 tr.addForm(f1040);
54
55 expect(f1040.getValue(tr, '2a')).toBe(95);
56 expect(f1040.getValue(tr, '2b')).toBe(103.5);
57 });
58
59 test('dividend income', () => {
60 const p = Person.self('A');
61 const tr = new TaxReturn(2019);
62 const f1099div = new Form1099DIV({
63 payer: 'Brokerage',
64 payee: p,
65 ordinaryDividends: 100,
66 qualifiedDividends: 75,
67 totalCapitalGain: 100
68 });
69 tr.addForm(f1099div);
70 tr.addForm(f1099div);
71
72 const f1040 = new Form1040();
73 tr.addForm(f1040);
74
75 expect(f1040.getValue(tr, '3a')).toBe(75 * 2);
76 expect(f1040.getValue(tr, '3b')).toBe(200);
77 });