Skip to content

Commit

Permalink
Fixed default lon to east in aeronautical format (#3672)
Browse files Browse the repository at this point in the history
  • Loading branch information
offtherailz authored Apr 4, 2019
1 parent 6cc4248 commit afacd43
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,33 @@ describe("test the Annotations enahncers", () => {
document.body.innerHTML = '';
setTimeout(done);
});
it('rendering default values', () => {
const Sink = decimalToAeronautical(createSink(props => {
expect(props).toExist();
// east is default in aeronautical format
if (props.coordinate === "lon") {
expect(props.direction).toBe('E');
} else {
expect(props.direction).toBe('N');
}


}));
// lat
ReactDOM.render((<Sink
/>), document.getElementById("container"));
ReactDOM.render((<Sink
value={0}
/>), document.getElementById("container"));
// lon
ReactDOM.render((<Sink
coordinate="lon"
/>), document.getElementById("container"));
ReactDOM.render((<Sink
value={0}
coordinate="lon"
/>), document.getElementById("container"));
});
it('decimalToAeronautical conversion', (done) => {
const Sink = decimalToAeronautical(createSink( props => {
expect(props).toExist();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ const convertDDToDMS = (D, lng, {seconds} = {seconds: {decimals: 4}}) => {
degrees: "",
minutes: "",
seconds: "",
direction: lng ? 'W' : 'N' // let's chose some default direction if coord is 0
direction: lng ? 'E' : 'N' // let's chose some default direction if coord is 0
};
}
let values = {
Expand Down

0 comments on commit afacd43

Please sign in to comment.