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
6 import { Person } from '../core';
7 import { UnsupportedFeatureError } from '../core/Errors';
9 import Form1040, { FilingStatus } from './Form1040';
10 import Schedule1, { Schedule1Input } from './Schedule1';
11 import TaxReturn from './TaxReturn';
13 test('state tax refund', () => {
14 const p = Person.self('A');
15 const tr = new TaxReturn();
16 tr.addForm(new Form1040({
17 filingStatus: FilingStatus.Single
19 const f = new Schedule1({
20 stateAndLocalTaxableRefunds: 500
24 expect(f.getValue(tr, '9')).toBe(500);
25 expect(tr.getForm(Form1040).getValue(tr, '7a')).toBe(500);
28 test('unsupported inputs', () => {
29 const keys: (keyof Schedule1Input)[] = [
32 'rentalRealEstateRoyaltiesPartnershipsSCorps',
34 'businessExpensesForm2106',
36 'armedForcesMovingExpenses',
37 'deductibleSelfEmploymentTax',
40 for (const input of keys) {
41 const p = Person.self('A');
42 const tr = new TaxReturn();
43 const f = new Schedule1({
47 expect(() => f.getValue(tr, '9') + f.getValue(tr, '22')).toThrow(UnsupportedFeatureError);