application, with native hybrid wrappers for iOS and Android. It’s pretty cool, you should check it out!* * demo.bendigobank.com.au #MelbJS — Nov 12th 3
Asset pipeline “ball of mud” JS bundle • Lots of (soaking) *.ERB views • Business logic sometimes in views (via helpers) • Views/JS hard to work on, lots of integration points. Working on the UI is frustrating! #MelbJS — Nov 12th 6
is an idempotent function (unit) • UI behaviour and structure live in the one place now • UI tests are now FAST(er)! • Closing huge holes in test coverage • Enforce UI rules with code! • Unifies where UI tests should live #MelbJS — Nov 12th 17
describe '.is-expanded', -> it 'does not have an ".is-expanded" class unless expanded', -> expect(@node.hasClass('is-expanded')).to.equal(false) @panel.setState(isExpanded: true) expect(@node.hasClass('is-expanded')).to.equal(true) describe '.is-href', -> it 'has an ".is-href" class when the panel acts as an anchor', -> expect(@node.hasClass('is-href')).to.equal(false) @panel.setProps(onTouchTap: sinon.spy) expect(@node.hasClass('is-href')).to.equal(true) #MelbJS — Nov 12th 20
disclosure /> ]) it 'toggles the isExpanded state when the disclosure is tapped', -> expect(@panel.state.isExpanded).to.equal(false) ReactTestUtils.Simulate.touchTap(@panel.refs.disclosureLink.getDOMNode()) expect(@panel.state.isExpanded).to.equal(true) ReactTestUtils.Simulate.touchTap(@panel.refs.disclosureLink.getDOMNode()) expect(@panel.state.isExpanded).to.equal(false) #MelbJS — Nov 12th 21
in ./vendor/ui SAUCE=1 ./script/test --browsers IE8 # run the tests in IE8 SAUCE=1 ./script/test --browsers IE9,IE10,IE11 # run the tests in IE 9, 10 & 11 SAUCE=1 ./script/test --browsers LG_Nexus4 # ...etc, etc #MelbJS — Nov 12th 25