"DOES YOUR TEAM WRITE TESTS FOR BACK-END CODE?"1 1 State Of The Web Survey, August 2018, https://dev.to/devteam/state-of-the-web-data---call-for-analysis-2o75
"DOES YOUR TEAM WRITE TESTS FOR FRONT-END CODE?"1 1 State Of The Web Survey, August 2018, https://dev.to/devteam/state-of-the-web-data---call-for-analysis-2o75
function moneyFormatter(sum) { var sumNum = sum.toString().split('').reverse(); var sumFormatted = []; for (var i = 0; i < sumNum.length; i++) { var currNum = sumNum[i]; if (i != 0 && i % 3 == 0) { sumFormatted.push('.'); } sumFormatted.push(currNum); } if (sumFormatted.length > 0) { sumFormatted.reverse(); sumFormatted.push(' Euro'); } return sumFormatted.join('') }
describe('renders a link with an url and the "btn" class', () => { const wrapper = shallow( {linkText} ) it('renders a link element', () => { expect(wrapper.find('a')).toHaveLength(1) }) it('renders a link with a given url', () => { expect(wrapper.find('a').prop('href')).toEqual(testUrl) }) it('renders a link with a class', () => { expect(wrapper.hasClass('btn')).toBe(true) }) }) describe('renders a link with a given content', () => { it('renders a link with a text as children', () => { const wrapper = shallow( {linkText} ) expect(wrapper.text()).toBe(linkText) }) it('renders a link with an image as children', () => { const wrapper = shallow( {linkImage} ) expect(wrapper.contains(linkImage)).toBe(true) }) }) describe('can style specific looks "primary" and "secondary"', () => { it('adds a class for style primary', () => { const wrapper = shallow(
{linkText}
) expect(wrapper.hasClass('btn-primary')).toBe(true) expect(wrapper.hasClass('btn-secondary')).toBe(false) }) it('adds a class for style secondary', () => { const wrapper = shallow(