Skip to content

Commit

Permalink
bugfix/ATC-196 - Adds initial failing test for #196 bug
Browse files Browse the repository at this point in the history
  • Loading branch information
n8rzz committed Dec 14, 2016
1 parent 57aacc3 commit 03b680c
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 2 deletions.
5 changes: 4 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
- Replaces active airport icao in view with a zulu time clock [#135](https://github.com/n8rzz/atc/issues/135)
- Consolidates test fixtures in fixtures directory [#167](https://github.com/n8rzz/atc/issues/167)
* Addresses issue with video maps being drawn incorrectly. [#176](https://github.com/n8rzz/atc/issues/176)
- Updates `PositionModel` to run all calculations through the static `.calculatePosition()` method and vastly simplifies internal logic.
- Updates `PositionModel` to run all calculations through the static `.calculatePosition()` method and vastly simplifies internal logic.



Expand All @@ -37,6 +37,9 @@
- Streamlines flight number generation and adds new method to add new callsigns to the existing list [#151](https://github.com/n8rzz/atc/issues/151)
- Adds `_isNumber` check instead of `!magneticNorth` inside `PositionModel.calculatePosition()` and the `AirspaceModel` constructor. [#182](https://github.com/n8rzz/atc/issues/182)
- Originally reported under [#754](https://github.com/zlsa/atc/issues/754)
- Adds additional handling to `StandardRouteModel._buildEntryAndExitCollections` to handle case where `entryPoints` and `exitPoints` don't exist in the `airport.sids` definition [#196](https://github.com/n8rzz/atc/issues/196)
- Originally reported under [#760](https://github.com/zlsa/atc/issues/760)




Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -363,6 +363,8 @@ export default class StandardRouteModel extends BaseModel {
} else if (_has(standardRoute, 'exitPoints')) {
this._entryCollection = this._buildSegmentCollection(standardRoute.rwy);
this._exitCollection = this._buildSegmentCollection(standardRoute.exitPoints);
} else if (!_has(standardRoute, 'entryPoints') || !_has(standardRoute, 'exitPoints')) {
// edge case that should be handled under n8rzz#196
}
}

Expand Down
11 changes: 10 additions & 1 deletion test/airport/standardRoute/StandardRouteModel.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ ava('.gatherExitPointNames() retuns a list of the exitPoint fix names', t => {
t.true(_isEqual(result, expectedResult));
});

ava('.gatherExitPointNames() retuns an empty array if not exitPoints exist or the collection is undefined', t => {
ava('.gatherExitPointNames() retuns an empty array if no exitPoints exist or the collection is undefined', t => {
const model = new StandardRouteModel(SID_WITHOUT_EXIT_MOCK.TRALR6);
const result = model.gatherExitPointNames();

Expand Down Expand Up @@ -244,6 +244,15 @@ ava('._buildEntryAndExitCollections() maps rwy fixes to _entryCollection when ex
t.true(_isEqual(segmentModelNames, _keys(SID_MOCK.rwy)));
});

ava.skip('._buildEntryAndExitCollections() maps rwy fixes to _entryCollection when exitPoints is not present and rwy is present', t => {
const model = new StandardRouteModel(SID_WITHOUT_EXIT_MOCK);
model._buildEntryAndExitCollections(SID_WITHOUT_EXIT_MOCK);

const segmentModelNames = _map(model._entryCollection._items, (segmentModel) => segmentModel.name);

t.true(_isEqual(segmentModelNames, _keys(SID_WITHOUT_EXIT_MOCK.rwy)));
});

ava('._findBodyFixList() returns an empty array when ._bodySegmentModel is undefined', t => {
const model = new StandardRouteModel(SID_WITHOUT_BODY_MOCK);

Expand Down

0 comments on commit 03b680c

Please sign in to comment.