Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Unsolved issue] Large medicare wages leads to incorrect additional medicare tax #1129

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

zakpatterson
Copy link
Collaborator

@zakpatterson zakpatterson commented Apr 19, 2022

This is not a PR, it's an issue! - Someone wanting to assist may add github.com/zakpatterson as a remote and submit a PR there based on the fix-intermittent-fica-test-failure branch. Feel free to open a new PR here too though.

It appears that if medicare wages and medicare withholding are allowed to get very large, medicare tax amounts become incorrect.

Info causing fail. Note, it seems that medicare income is greater than income in a w2. That's possible right?

  {
    f1099s: [],
    w2s: [
      {
        occupation: '',
        income: 4936065,
        medicareIncome: 4246324,
      },
      {
        occupation: '',
        income: 9517878,
        medicareIncome: 8650774,
      },
      {
        occupation: '',
        income: 7016062,
        medicareIncome: 9947902,
        personRole: 'PRIMARY',
        ssWages: 0,
        ssWithholding: 0,
        medicareWithholding: 331253,
        state: 'AL',
        stateWages: 0,
        stateWithholding: 0,
        box12: {}
      }
    ],
    realEstate: [],
    estimatedTaxes: [],
    f1098es: [],
    f3921s: [],
    scheduleK1Form1065s: [],
    itemizedDeductions: {},
    taxPayer: {
      filingStatus: 'S',
      primaryPerson: {
        firstName: '',
        lastName: '',
        ssid: '000000000',
        role: 'PRIMARY',
        address: {
          address: '0 ',
          aptNo: '0',
          city: '',
          state: 'AL',
          zip: '000000000'
        },
        isTaxpayerDependent: false
      },
      spouse: undefined,
      dependents: [],
      contactEmail: '@.',
      contactPhoneNumber: '0000000000'
    },
    questions: {},
    stateResidencies: [{ state: 'AL' }],
    healthSavingsAccounts: [],
    credits: [],
    individualRetirementArrangements: []
  },
  []
]

test output

 FAIL  src/forms/Y2020/tests/fica.test.ts
  fica
     should give refund SS tax overpayment only in some conditions (431 ms)
     should give SS refund based on filing status (348 ms)
     should not give a refund if each person has less than the max (315 ms)
     should give a refund if a person has more than the max if they have two w2s (320 ms)
     should add Additional Medicare Tax form 8959 (289 ms)
     should add Additional Medicare Tax based on filing status (721 ms)

   fica  should add Additional Medicare Tax based on filing status

    Property failed after 1 tests
    { seed: 307263146, path: "32:0:25:1:24:24:24:24:24:24:24:24:24:24:24:24:24:24:24:24:24:24:24:24:24:24:24:24:24:24:24:24:24:24:50:50:50:50:50:50:50:50:50:50:50:50:50:50:50:50:50:50:50:50:50:50:50:50:50:50:50:50:50:50:50:50:50:98:75:75:77:75:77:75:78:75:75:75:79:76:76:76:76:76:76:76:76:76:76:76:76:76:76:76:76:76:76:76:76:76:76:76:76:76:76:76:76:76:76:76:76:76:76:76:76:76:76:76:76:76:76:76:76:76:76:76:76:76:76:76:76:76:76:76:76:76:76:76:76:76:76:76:76:76:76:76:76:76:76:76:76:76:76:76:76:76:76:76:76:76:76:76:76:76:76:76:76:76:76:76:76:76:76:76:76:76:76:76:76", endOnFailure: true }
    Shrunk 0 time(s)
    Got error: Error: expect(received).toBeUndefined()

    Received: 1

    Stack trace: Error: expect(received).toBeUndefined()

    Received: 1

      241 |           )
      242 |         } else {
    > 243 |           expect(displayRound(f1040.l25c())).toBeUndefined()
          |                                              ^
      244 |         }
      245 |       }
      246 |     }, failParams)

What kind of change does this PR introduce? (delete not applicable)

  • Bugfix

It appears that if medicare wages and medicare
withholding are allowed to get very large,
medicare tax amounts become incorrect.

 FAIL  src/forms/Y2020/tests/fica.test.ts
  fica
    ✓ should give refund SS tax overpayment only in some conditions (431 ms)
    ✓ should give SS refund based on filing status (348 ms)
    ✓ should not give a refund if each person has less than the max (315 ms)
    ✓ should give a refund if a person has more than the max if they have two w2s (320 ms)
    ✓ should add Additional Medicare Tax form 8959 (289 ms)
    ✕ should add Additional Medicare Tax based on filing status (721 ms)

  ● fica › should add Additional Medicare Tax based on filing status

    Property failed after 1 tests
    { seed: 307263146, path: "32:0:25:1:24:24:24:24:24:24:24:24:24:24:24:24:24:24:24:24:24:24:24:24:24:24:24:24:24:24:24:24:24:24:50:50:50:50:50:50:50:50:50:50:50:50:50:50:50:50:50:50:50:50:50:50:50:50:50:50:50:50:50:50:50:50:50:98:75:75:77:75:77:75:78:75:75:75:79:76:76:76:76:76:76:76:76:76:76:76:76:76:76:76:76:76:76:76:76:76:76:76:76:76:76:76:76:76:76:76:76:76:76:76:76:76:76:76:76:76:76:76:76:76:76:76:76:76:76:76:76:76:76:76:76:76:76:76:76:76:76:76:76:76:76:76:76:76:76:76:76:76:76:76:76:76:76:76:76:76:76:76:76:76:76:76:76:76:76:76:76:76:76:76:76:76:76:76:76", endOnFailure: true }
    Counterexample: [{"f1099s":[],"w2s":[{"occupation":"","income":4936065,"medicareIncome":4246324,"fedWithholding":0,"employer":{"EIN":"000000000","employerName":" ","address":{"address":"0 ","aptNo":"0","city":"","state":"AL","zip":"000000000"}},"personRole":"PRIMARY","ssWages":0,"ssWithholding":0,"medicareWithholding":0,"state":"AL","stateWages":0,"stateWithholding":0,"box12":{}},{"occupation":"","income":9517878,"medicareIncome":8650774,"fedWithholding":0,"employer":{"EIN":"000000000","employerName":" ","address":{"address":"0 ","aptNo":"0","city":"","state":"AL","zip":"000000000"}},"personRole":"PRIMARY","ssWages":0,"ssWithholding":0,"medicareWithholding":0,"state":"AL","stateWages":0,"stateWithholding":0,"box12":{}},{"occupation":"","income":7016062,"medicareIncome":9947902,"fedWithholding":0,"employer":{"EIN":"000000000","employerName":" ","address":{"address":"0 ","aptNo":"0","city":"","state":"AL","zip":"00000"}},"personRole":"PRIMARY","ssWages":0,"ssWithholding":0,"medicareWithholding":331253,"state":"AL","stateWages":0,"stateWithholding":0,"box12":{}}],"realEstate":[],"estimatedTaxes":[],"f1098es":[],"f3921s":[],"scheduleK1Form1065s":[],"itemizedDeductions":{"medicalAndDental":0,"stateAndLocalTaxes":0,"isSalesTax":false,"stateAndLocalRealEstateTaxes":0,"stateAndLocalPropertyTaxes":0,"interest8a":0,"interest8b":0,"interest8c":0,"interest8d":0,"investmentInterest":0,"charityCashCheck":0,"charityOther":0},"refund":{"routingNumber":"000000000","accountNumber":"0000","accountType":"checking"},"taxPayer":{"filingStatus":"S","primaryPerson":{"firstName":"","lastName":"","ssid":"000000000","role":"PRIMARY","address":{"address":"0 ","aptNo":"0","city":"","state":"AL","zip":"000000000"},"isTaxpayerDependent":false},"spouse":undefined,"dependents":[],"contactEmail":"@.","contactPhoneNumber":"0000000000"},"questions":{},"stateResidencies":[{"state":"AL"}],"healthSavingsAccounts":[],"credits":[],"individualRetirementArrangements":[]},[]]
    Shrunk 0 time(s)
    Got error: Error: expect(received).toBeUndefined()

    Received: 1

    Stack trace: Error: expect(received).toBeUndefined()

    Received: 1

      241 |           )
      242 |         } else {
    > 243 |           expect(displayRound(f1040.l25c())).toBeUndefined()
          |                                              ^
      244 |         }
      245 |       }
      246 |     }, failParams)
@@ -198,6 +198,13 @@ describe('fica', () => {
})
})

const failParams = {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After fixing test, remove this special case

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant