Add license information.
[ustaxlib.git] / src / fed2019 / Form8606.test.ts
1 // Copyright 2020 Blue Static <https://www.bluestatic.org>
2 // This program is free software licensed under the GNU General Public License,
3 // version 3.0. The full text of the license can be found in LICENSE.txt.
4 // SPDX-License-Identifier: GPL-3.0-only
5
6 import { Person } from '../core';
7
8 import Form1040, { FilingStatus } from './Form1040';
9 import Form8606 from './Form8606';
10 import TaxReturn from './TaxReturn';
11
12 test('skip part 1', () => {
13 const p = Person.self('A');
14 const tr = new TaxReturn();
15 tr.addPerson(p);
16 const f = new Form8606({
17 person: p,
18 nondeductibleContributions: 6000,
19 traditionalIraBasis: 0,
20 distributionFromTradSepOrSimpleIraOrMadeRothConversion: false
21 });
22 tr.addForm(f);
23
24 expect(f.getValue(tr, '14')).toBe(6000);
25 });
26
27 test('Roth conversion no basis', () => {
28 const p = Person.self('A');
29 const tr = new TaxReturn();
30 tr.addPerson(p);
31 const f = new Form8606({
32 person: p,
33 nondeductibleContributions: 6000,
34 traditionalIraBasis: 0,
35 distributionFromTradSepOrSimpleIraOrMadeRothConversion: true,
36 contributionsMadeInCurrentYear: 0,
37 valueOfAllTradSepSimpleIras: 0,
38 distributionsFromAllTradSepSimpleIras: 0,
39 amountConvertedFromTradSepSimpleToRoth: 6000,
40 });
41 tr.addForm(f);
42
43 expect(f.getValue(tr, '9')).toBe(6000);
44 expect(f.getValue(tr, '13')).toBe(6000);
45 expect(f.getValue(tr, '14')).toBe(0);
46 expect(f.getValue(tr, '15c')).toBe(0);
47 expect(f.getValue(tr, '16')).toBe(6000);
48 expect(f.getValue(tr, '17')).toBe(6000);
49 expect(f.getValue(tr, '18')).toBe(0);
50 });