montagejs/montage — pull request #1307 by asolove (2013-10-01 14:01:32+00:00)
Title: Suggested fix for overlay test failures.

The combination of the [Overlay work](https://github.com/montagejs/montage/pull/1299) and @aadsm's [work on draw](https://github.com/montagejs/montage/commit/4af44d85fced9a0c54fab62e541a016b72d36a26) causes test failures:

```
TypeError: Cannot call method 'isComponentWaitingNeedsDraw' of undefined
at Object.exports.Component.Target.specialize.addChildComponent.value [as addChildComponent] (http://localhost/declarativ/declarativ/montage/ui/component.js:680:41)
at Overlay.exports.Component.Target.specialize.attachToParentComponent.value (http://localhost/declarativ/declarativ/montage/ui/component.js:713:33)
at Overlay.exports.Overlay.Component.specialize.enterDocument.value (http://localhost/declarativ/declarativ/montage/ui/overlay.reel/overlay.js:155:22)
at eval (http://localhost/declarativ/declarativ/montage/test/ui/overlay-spec.js:19:19)
```

The problem appears to be that the mocks for component and rootComponent do not have the rootComponent property or the new isComponentWaitingNeedsDraw method.

The PR contains one possible fix, but there are other options:

1. Implement isComponentWaitingNeedsDraw more realistically.
2. Make overlay specs into functional rather than unit tests, using montage-testing to get a real rootComponent