forked from kt3k/japanese-income-tax
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathspec.js
50 lines (44 loc) · 1.5 KB
/
spec.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
var tax = require('./')
var expect = require('chai').expect
describe('incomeTax', function () {
it('returns the income tax', function () {
expect(tax.incomeTax(1005000)).to.equal(50250)
expect(tax.incomeTax(2005000)).to.equal(103000)
expect(tax.incomeTax(4005000)).to.equal(373500)
expect(tax.incomeTax(8005000)).to.equal(1205150)
expect(tax.incomeTax(8005999)).to.equal(1205150)
expect(tax.incomeTax(16005000)).to.equal(3745650)
expect(tax.incomeTax(32005000)).to.equal(10006000)
})
})
describe('specialIncomeTax', function () {
it('returns the Recostruction special income tax', function () {
expect(tax.specialIncomeTax(8005000)).to.equal(25308)
})
})
describe('totalIncomeTax', function () {
it('returns the total of the income taxes', function () {
expect(tax.totalIncomeTax(8005000)).to.equal(1230458)
})
})
describe('actualIncomeTax', function () {
it('returns the actual amount of the income taxes which is paid to the government', function () {
expect(tax.actualIncomeTax(8005000)).to.equal(1230400)
})
})
describe('residentTax', function () {
it('returns the income tax', function () {
expect(tax.incomeTax(8005000)).to.equal(1205150)
})
})
describe('getDetails', function () {
it('returns the details of the income based taxes', function () {
expect(tax.getDetails(8005000)).to.eql({
incomeTax: 1205150,
specialIncomeTax: 25308,
totalIncomeTax: 1230458,
actualIncomeTax: 1230400,
residentTax: 800500
})
})
})