Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed default lon to east in aeronautical format #3672

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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