-
Notifications
You must be signed in to change notification settings - Fork 127
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into dbex/97078-events-type-selection-shell
- Loading branch information
Showing
152 changed files
with
1,140 additions
and
71 deletions.
There are no files selected for viewing
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions
4
...ty-benefits/686c-674-v2/sass/new-686.scss → src/applications/686c-674/sass/new-686.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,12 @@ | ||
import * as institutionDetails from './institutionDetails'; | ||
import { ProgramIntro } from './program-intro'; | ||
import { programInfo } from './program-info'; | ||
import { ProgramSummary } from './program-summary'; | ||
import { ProgramSummary, arrayBuilderOptions } from './program-summary'; | ||
|
||
export { institutionDetails, ProgramIntro, programInfo, ProgramSummary }; | ||
export { | ||
institutionDetails, | ||
ProgramIntro, | ||
programInfo, | ||
ProgramSummary, | ||
arrayBuilderOptions, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 42 additions & 0 deletions
42
src/applications/edu-benefits/10215/tests/config/form.unit.spec.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
import { expect } from 'chai'; | ||
import sinon from 'sinon'; | ||
import { render } from '@testing-library/react'; | ||
import formConfig, { arrayBuilderOptions } from '../../config/form'; | ||
import manifest from '../../manifest.json'; | ||
|
||
describe('22-10215 Form Config', () => { | ||
it('should render', () => { | ||
expect(formConfig).to.be.an('object'); | ||
}); | ||
it('should have a required properties', () => { | ||
expect(formConfig.rootUrl).to.contain(manifest.rootUrl); | ||
expect(formConfig.title).to.contain('Report 85/15 Rule enrollment ratio'); | ||
const { getByText } = render(formConfig.subTitle()); // Render the subTitle component | ||
expect( | ||
getByText( | ||
'Statement of Assurance of Compliance with 85% Enrollment Ratios (VA Form 22-10215)', | ||
), | ||
).of.exist; | ||
expect(formConfig).to.have.property('chapters'); | ||
}); | ||
it('should return the correct item name', () => { | ||
const item = { programName: 'Test Program' }; | ||
expect(arrayBuilderOptions.text.getItemName(item)).to.equal('Test Program'); | ||
}); | ||
|
||
it('should return the correct card description', () => { | ||
const item = { | ||
programName: 'Test Program', | ||
supportedFTEPercent: 50, | ||
}; | ||
const mockGetFTECalcs = sinon.stub().returns({ supportedFTEPercent: 50 }); | ||
global.getFTECalcs = mockGetFTECalcs; | ||
const description = arrayBuilderOptions.text.cardDescription(item); | ||
expect(description).to.not.equal('50 supported student FTE'); | ||
|
||
mockGetFTECalcs.returns({ supportedFTEPercent: null }); | ||
expect(arrayBuilderOptions.text.cardDescription(item)).to.be.null; | ||
|
||
delete global.getFTECalcs; | ||
}); | ||
}); |
58 changes: 58 additions & 0 deletions
58
src/applications/edu-benefits/10215/tests/config/transform.unit.spec.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
import { expect } from 'chai'; | ||
import sinon from 'sinon'; | ||
import * as helpers from '../../helpers'; | ||
import transform from '../../config/transform'; | ||
|
||
describe('transform utility function', () => { | ||
let formConfig; | ||
let form; | ||
let getFTECalcsStub; | ||
|
||
beforeEach(() => { | ||
formConfig = {}; | ||
form = { | ||
data: { | ||
programs: [ | ||
{ | ||
programName: 'Program A', | ||
supportedStudents: '10', | ||
fte: { | ||
totalFTE: 0, | ||
supportedPercentageFTE: 0, | ||
}, | ||
}, | ||
{ | ||
programName: 'Program B', | ||
supportedStudents: '9', | ||
fte: { | ||
totalFTE: 0, | ||
supportedPercentageFTE: 0, | ||
}, | ||
}, | ||
], | ||
}, | ||
}; | ||
getFTECalcsStub = sinon.stub(helpers, 'getFTECalcs'); | ||
}); | ||
|
||
afterEach(() => { | ||
getFTECalcsStub.restore(); | ||
}); | ||
it('should not modify FTE fields if the program has fewer than 10 supported students', () => { | ||
form.data.programs = [ | ||
{ | ||
programName: 'Program C', | ||
supportedStudents: '8', | ||
fte: { | ||
totalFTE: 0, | ||
supportedPercentageFTE: 0, | ||
}, | ||
}, | ||
]; | ||
|
||
const resultString = transform(formConfig, form); | ||
const resultObject = JSON.parse(resultString); | ||
expect(resultObject.educationBenefitsClaim).to.exist; | ||
expect(resultObject.educationBenefitsClaim.form).to.exist; | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
60 changes: 60 additions & 0 deletions
60
src/applications/edu-benefits/10215/tests/helper.unit.spec.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
// src/applications/edu-benefits/10215/helpers.test.js | ||
import { expect } from 'chai'; | ||
import { getFTECalcs } from '../helpers'; | ||
|
||
describe('getFTECalcs', () => { | ||
it('should return correct FTE calculations for supported and non-supported values', () => { | ||
const program = { fte: { supported: 5, nonSupported: 15 } }; | ||
const result = getFTECalcs(program); | ||
expect(result).to.deep.equal({ | ||
supported: 5, | ||
nonSupported: 15, | ||
total: 20, | ||
supportedFTEPercent: '25%', | ||
}); | ||
}); | ||
|
||
it('should handle zero supported and non-supported values', () => { | ||
const program = { fte: { supported: 0, nonSupported: 0 } }; | ||
const result = getFTECalcs(program); | ||
expect(result).to.deep.equal({ | ||
supported: 0, | ||
nonSupported: 0, | ||
total: 0, | ||
supportedFTEPercent: null, | ||
}); | ||
}); | ||
|
||
it('should handle only supported values', () => { | ||
const program = { fte: { supported: 10, nonSupported: 0 } }; | ||
const result = getFTECalcs(program); | ||
expect(result).to.deep.equal({ | ||
supported: 10, | ||
nonSupported: 0, | ||
total: 10, | ||
supportedFTEPercent: '100%', | ||
}); | ||
}); | ||
|
||
it('should handle only non-supported values', () => { | ||
const program = { fte: { supported: 0, nonSupported: 10 } }; | ||
const result = getFTECalcs(program); | ||
expect(result).to.deep.equal({ | ||
supported: 0, | ||
nonSupported: 10, | ||
total: 10, | ||
supportedFTEPercent: null, | ||
}); | ||
}); | ||
|
||
it('should return null for supportedFTEPercent when total is NaN', () => { | ||
const program = { fte: { supported: null, nonSupported: null } }; | ||
const result = getFTECalcs(program); | ||
expect(result).to.deep.equal({ | ||
supported: 0, | ||
nonSupported: 0, | ||
total: 0, | ||
supportedFTEPercent: null, | ||
}); | ||
}); | ||
}); |
81 changes: 81 additions & 0 deletions
81
src/applications/edu-benefits/10215/tests/pages/calcs.unit.spec.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
// src/applications/edu-benefits/10215/pages/calcs.test.js | ||
import React from 'react'; | ||
import { mount } from 'enzyme'; | ||
import { expect } from 'chai'; | ||
import { Provider } from 'react-redux'; | ||
import configureStore from 'redux-mock-store'; | ||
import Calcs from '../../pages/calcs'; | ||
|
||
const mockStore = configureStore(); | ||
|
||
describe('<Calcs />', () => { | ||
const mockData = { | ||
programs: [ | ||
{ | ||
supported: true, | ||
nonSupported: false, | ||
total: 10, | ||
supportedFTEPercent: 100, | ||
}, | ||
], | ||
}; | ||
|
||
it('should render correctly with given props', () => { | ||
const store = mockStore({ form: { data: mockData } }); | ||
const wrapper = mount( | ||
<Provider store={store}> | ||
<Calcs data={mockData} /> | ||
</Provider>, | ||
); | ||
|
||
expect( | ||
wrapper | ||
.find('label') | ||
.at(0) | ||
.text(), | ||
).to.equal('Total Enrolled FTE'); | ||
expect( | ||
wrapper | ||
.find('span') | ||
.at(0) | ||
.text(), | ||
).to.equal('--'); | ||
expect( | ||
wrapper | ||
.find('label') | ||
.at(1) | ||
.text(), | ||
).to.equal('Supported student percentage FTE'); | ||
expect( | ||
wrapper | ||
.find('span') | ||
.at(1) | ||
.text(), | ||
).to.equal('--%'); | ||
wrapper.unmount(); | ||
}); | ||
|
||
it('should render "--" when no data is available', () => { | ||
const emptyData = { programs: [] }; | ||
const store = mockStore({ form: { data: emptyData } }); | ||
const wrapper = mount( | ||
<Provider store={store}> | ||
<Calcs data={emptyData} /> | ||
</Provider>, | ||
); | ||
|
||
expect( | ||
wrapper | ||
.find('span') | ||
.at(0) | ||
.text(), | ||
).to.equal('--'); | ||
expect( | ||
wrapper | ||
.find('span') | ||
.at(1) | ||
.text(), | ||
).to.equal('--%'); | ||
wrapper.unmount(); | ||
}); | ||
}); |
Oops, something went wrong.