Redo 1099-B to be simplerf for recording adjustments.
[ustaxlib.git] / src / fed2019 / Form8995.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 Form1099B from './Form1099B';
10 import Form1099DIV from './Form1099DIV';
11 import Form8949 from './Form8949';
12 import Form8995REIT from './Form8995';
13 import ScheduleD from './ScheduleD';
14 import TaxReturn from './TaxReturn';
15
16 test('REIT QBI no Schedule D', () => {
17 const p = Person.self('A');
18 const tr = new TaxReturn();
19 tr.addPerson(p);
20 tr.addForm(new Form1040({ filingStatus: FilingStatus.Single }));
21 tr.addForm(new Form1099DIV({
22 payer: 'Brokerage',
23 payee: p,
24 ordinaryDividends: 50000,
25 qualifiedDividends: 35000,
26 totalCapitalGain: 7500,
27 section199ADividends: 2220,
28 }));
29
30 const f = new Form8995REIT();
31 tr.addForm(f);
32
33 expect(f.getValue(tr, '28')).toBe(2220);
34 expect(f.getValue(tr, '31')).toBe(444);
35 expect(f.getValue(tr, '32')).toBe(444);
36 expect(f.getValue(tr, '33')).toBe(50000 - 12200);
37 expect(f.getValue(tr, '34')).toBe(35000);
38 expect(f.getValue(tr, '39')).toBe(444);
39 expect(f.getValue(tr, '40')).toBe(0);
40 expect(tr.getForm(Form1040).getValue(tr, '10')).toBe(444);
41 });
42
43 test('REIT QBI with Schedule D', () => {
44 const p = Person.self('A');
45 const tr = new TaxReturn();
46 tr.addPerson(p);
47 tr.addForm(new Form1040({ filingStatus: FilingStatus.Single }));
48 tr.addForm(new Form1099DIV({
49 payer: 'Brokerage',
50 payee: p,
51 ordinaryDividends: 50000,
52 qualifiedDividends: 35000,
53 totalCapitalGain: 7500,
54 section199ADividends: 2220,
55 }));
56 tr.addForm(new Form1099B({
57 payer: 'Brokerage2 ',
58 payee: p,
59 longTermBasisReported: [
60 {
61 description: '100 VTI',
62 proceeds: 230000,
63 costBasis: 221000,
64 }
65 ]
66 }));
67 tr.addForm(new Form8949);
68 tr.addForm(new ScheduleD);
69
70 const f = new Form8995REIT();
71 tr.addForm(f);
72
73 expect(f.getValue(tr, '28')).toBe(2220);
74 expect(f.getValue(tr, '31')).toBe(444);
75 expect(f.getValue(tr, '32')).toBe(444);
76 expect(f.getValue(tr, '33')).toBe(50000 + 7500 + 9000 - 12200);
77 expect(f.getValue(tr, '34')).toBe(35000 + 7500 + 9000);
78 expect(f.getValue(tr, '39')).toBe(444);
79 expect(f.getValue(tr, '40')).toBe(0);
80 expect(tr.getForm(Form1040).getValue(tr, '10')).toBe(444);
81 });