diff --git a/src/view/components/toolbar/motion/Accelerometer.spec.tsx b/src/view/components/toolbar/motion/Accelerometer.spec.tsx new file mode 100644 index 000000000..ec89b4ebf --- /dev/null +++ b/src/view/components/toolbar/motion/Accelerometer.spec.tsx @@ -0,0 +1,44 @@ +import * as React from "react"; +import * as ReactDOM from "react-dom"; +import { IntlProvider } from "react-intl"; +import * as testRenderer from "react-test-renderer"; +import { Accelerometer } from "./Accelerometer"; + +describe("Accelerometer component ", () => { + const mockProps = { + axisValues: { + X_AXIS: 1, + Y_AXIS: 0, + Z_AXIS: 1, + }, + onUpdateValue: () => {}, + }; + + it("should render correctly", () => { + const component = testRenderer + .create( + + + + ) + .toJSON(); + expect(component).toMatchSnapshot(); + }); + + it("should render without crashing", () => { + const div = document.createElement("div"); + ReactDOM.render( + + + , + div + ); + ReactDOM.unmountComponentAtNode(div); + }); +}); diff --git a/src/view/components/toolbar/motion/__snapshots__/Accelerometer.spec.tsx.snap b/src/view/components/toolbar/motion/__snapshots__/Accelerometer.spec.tsx.snap new file mode 100644 index 000000000..802e95714 --- /dev/null +++ b/src/view/components/toolbar/motion/__snapshots__/Accelerometer.spec.tsx.snap @@ -0,0 +1,298 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`Accelerometer component should render correctly 1`] = ` +
+
+
+ + +
+
+
+

+ Set the acceleration manually here +

+
+
+
+ + X + + + + + + -1023 + + + 1023 + + + + + + Left + + + Right + + + +
+
+
+ + Y + + + + + + -1023 + + + 1023 + + + + + + Back + + + Front + + + +
+
+
+ + Z + + + + + + -1023 + + + 1023 + + + + + + Up + + + Down + + + +
+
+
+`; diff --git a/src/view/styles/MotionSensorBar.css b/src/view/styles/MotionSensorBar.css index b12a8d829..8ea39c23c 100644 --- a/src/view/styles/MotionSensorBar.css +++ b/src/view/styles/MotionSensorBar.css @@ -14,6 +14,7 @@ margin-left: auto; margin-right: auto; } + .sensor-button-container { - padding: 10px 0 10px 0; + padding: 10px 0; } diff --git a/src/view/styles/SensorButton.css b/src/view/styles/SensorButton.css index a821794ee..21241eca2 100644 --- a/src/view/styles/SensorButton.css +++ b/src/view/styles/SensorButton.css @@ -18,10 +18,12 @@ outline: 2px solid var(--vscode-focusBorder); background-color: var(--vscode-button-hoverBackground); } + .sensor-button:active, .active-button { opacity: 0.5; } + .sensor-button:hover { background-color: var(--vscode-button-hoverBackground); }