General approach for functional testing:
Do programmatic user interactions via headless browser and analyze the resulting DOM mutations.
- Gotcha: Phantom 2 downloaded from official site doesn't work on Yosemite. Get a working binary here.
- mocha-phantomjs looks promising but isn't on 2 yet.