diff --git a/web/client/components/misc/coordinateeditors/enhancers/__tests__/decimalToAeronautical-test.js b/web/client/components/misc/coordinateeditors/enhancers/__tests__/decimalToAeronautical-test.js index 1696e4b1ff..da70207977 100644 --- a/web/client/components/misc/coordinateeditors/enhancers/__tests__/decimalToAeronautical-test.js +++ b/web/client/components/misc/coordinateeditors/enhancers/__tests__/decimalToAeronautical-test.js @@ -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((), document.getElementById("container")); + ReactDOM.render((), document.getElementById("container")); + // lon + ReactDOM.render((), document.getElementById("container")); + ReactDOM.render((), document.getElementById("container")); + }); it('decimalToAeronautical conversion', (done) => { const Sink = decimalToAeronautical(createSink( props => { expect(props).toExist(); diff --git a/web/client/components/misc/coordinateeditors/enhancers/decimalToAeronautical.js b/web/client/components/misc/coordinateeditors/enhancers/decimalToAeronautical.js index d86eedd5f8..aac134010f 100644 --- a/web/client/components/misc/coordinateeditors/enhancers/decimalToAeronautical.js +++ b/web/client/components/misc/coordinateeditors/enhancers/decimalToAeronautical.js @@ -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 = {