Skip to content

Commit

Permalink
Merge pull request #1081 from flexion/sprint_9_comments
Browse files Browse the repository at this point in the history
Sprint 9 - Addressing PR Comments
  • Loading branch information
codyseibert authored Mar 13, 2019
2 parents 34a6bca + 48c0598 commit 98644a3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 85 deletions.
81 changes: 0 additions & 81 deletions shared/src/business/useCases/validateCaseDetailInteractor.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,87 +76,6 @@ describe('validate case detail', () => {
expect(errors.payGovDate).toBeTruthy();
});

xit('returns an error if yearAmounts is missing a required value', () => {
const errors = validateCaseDetail({
caseDetail: {
caseType: 'defined',
docketNumber: '101-18',
documents: [
{
createdAt: '2018-11-21T20:49:28.192Z',
documentId: 'c6b81f4d-1e47-423a-8caf-6d2fdc3d3859',
documentType: 'Petition',
reviewDate: '2018-11-21T20:49:28.192Z',
reviewUser: 'petitionsclerk',
role: 'petitioner',
userId: 'taxpayer',
workItems: [],
},
{
createdAt: '2018-11-21T20:49:28.192Z',
documentId: 'c6b81f4d-1e47-423a-8caf-6d2fdc3d3859',
documentType: 'Petition',
reviewDate: '2018-11-21T20:49:28.192Z',
reviewUser: 'petitionsclerk',
role: 'petitioner',
userId: 'taxpayer',
workItems: [],
},
],
filingType: 'defined',
hasIrsNotice: true,
irsNoticeDate: new Date().toISOString(),
petitioners: [{ name: 'user' }],
procedureType: 'defined',
signature: true,
yearAmounts: [
{
amount: '123',
},
{
year: '1236-01-01',
},
{
amount: '1000',
year: '1234-01-01',
},
{
amount: '1000',
year: '2100-01-01',
},
{
amount: '123',
year: '2200-01-01',
},
],
},
});
expect(errors.preferredTrialCity).toEqual(
'Preferred Trial City is required.',
);

const yearAmount0 = errors.yearAmounts.find(
yearAmount => yearAmount.index === 0,
);

const yearAmount3 = errors.yearAmounts.find(
yearAmount => yearAmount.index === 3,
);

const yearAmount4 = errors.yearAmounts.find(
yearAmount => yearAmount.index === 4,
);
expect(yearAmount0.year).toEqual('Please enter a valid year.');
expect(yearAmount0.amount).toBeUndefined();
expect(yearAmount3.year).toEqual(
'That year is in the future. Please enter a valid year.',
);
expect(yearAmount4.year).toEqual(
'That year is in the future. Please enter a valid year.',
);
expect(yearAmount4.index).toEqual(4);
});

it('returns an error if yearAmounts have duplicate years', () => {
const errors = validateCaseDetail({
caseDetail: {
Expand Down
8 changes: 4 additions & 4 deletions web-client/src/ustc-ui/utils/ElementChildren.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import React from 'react';
import { forEach, getDefaultAttribute, map } from './ElementChildren';

describe('map', () => {
it('should map items and skip non elements', () => {
it('should map items and not alter non elements', () => {
const children = [
<div key="what">sds</div>,
22,
Expand All @@ -17,7 +17,7 @@ describe('map', () => {
).toEqual([0, 22, 1]);
});

it('should map items and exclude null', () => {
it('should map items and exclude null values from results', () => {
const children = [
<div key="what">sds</div>,
<div key="whatever">something</div>,
Expand All @@ -36,7 +36,7 @@ describe('map', () => {
});

describe('forEach', () => {
it('should map items and exclude null', () => {
it('should loop over items and skip non-react items', () => {
const children = [
<div key="what">sds</div>,
22,
Expand All @@ -54,7 +54,7 @@ describe('forEach', () => {
});

describe('getDefaultAttribute', () => {
it('should find first attribute and return', () => {
it('should find the first attribute and return that attribute', () => {
const children = [
<div key="what" kid="someIds">
sds
Expand Down

0 comments on commit 98644a3

Please sign in to comment.