Merge branch 'main' into release/0.10.0
This commit is contained in:
@@ -23,7 +23,7 @@ const checkVehiclesResult = (error, busy, vehicles) => {
|
||||
const checkFleetsResult = (error, busy, fleets) => {
|
||||
checkBaseResults(error, busy);
|
||||
expect(screen.getByTestId("fleets").innerHTML).toEqual(fleets);
|
||||
}
|
||||
};
|
||||
|
||||
const checkBaseResults = (error, busy) => {
|
||||
expect(screen.getByTestId("error").innerHTML).toEqual(error);
|
||||
@@ -69,7 +69,7 @@ describe("VehicleContext", () => {
|
||||
);
|
||||
checkFleetsResult("", "false", JSON.stringify(["fleet1", "fleet2"]));
|
||||
});
|
||||
})
|
||||
});
|
||||
|
||||
describe("getVehicles", () => {
|
||||
beforeEach(() => {
|
||||
|
||||
@@ -19,8 +19,8 @@ export const Parameters = (props) => {
|
||||
{params.dataFunc(data, handleDataChange)}
|
||||
</div>
|
||||
</FormControl>
|
||||
)
|
||||
}
|
||||
);
|
||||
};
|
||||
|
||||
Parameters.propTypes = {
|
||||
params: PropTypes.any,
|
||||
|
||||
@@ -5,7 +5,7 @@ import addSnapshotSerializer from "../../../utils/snapshot";
|
||||
const renderState = {
|
||||
EMPTY: 0,
|
||||
JUST_DATA: 1,
|
||||
}
|
||||
};
|
||||
|
||||
const renderParameters = async (rs) => {
|
||||
await waitFor(() => {
|
||||
@@ -13,37 +13,40 @@ const renderParameters = async (rs) => {
|
||||
});
|
||||
|
||||
if (rs === renderState.EMPTY) {
|
||||
const { container } = render(<Parameters/>)
|
||||
const { container } = render(<Parameters />);
|
||||
|
||||
return container;
|
||||
}
|
||||
const params = {dataFunc:(val, handleValChange) => <div>val.toString()</div>}
|
||||
const params = {
|
||||
dataFunc: (val, handleValChange) => <div>val.toString()</div>,
|
||||
};
|
||||
const [data, handleDataChange] = [true, (_) => {}];
|
||||
|
||||
if (rs === renderState.JUST_DATA) {
|
||||
const { container } = render(<Parameters
|
||||
const { container } = render(
|
||||
<Parameters
|
||||
params={params}
|
||||
data={data}
|
||||
handleDataChange={handleDataChange}
|
||||
/>)
|
||||
/>
|
||||
);
|
||||
|
||||
return container;
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
describe("Params", () => {
|
||||
beforeAll(() => {
|
||||
addSnapshotSerializer(expect);
|
||||
})
|
||||
});
|
||||
|
||||
it("Render empty", async () => {
|
||||
const container = await renderParameters(renderState.EMPTY);
|
||||
expect(container).toMatchSnapshot();
|
||||
})
|
||||
});
|
||||
|
||||
it("Render just data", async () => {
|
||||
const container = await renderParameters(renderState.JUST_DATA);
|
||||
expect(container).toMatchSnapshot();
|
||||
})
|
||||
})
|
||||
});
|
||||
});
|
||||
|
||||
@@ -6,7 +6,7 @@ import {
|
||||
TableFooter,
|
||||
TablePagination,
|
||||
TableRow,
|
||||
Tooltip,
|
||||
Tooltip
|
||||
} from "@material-ui/core";
|
||||
import AddCircleIcon from "@material-ui/icons/AddCircle";
|
||||
import DeleteIcon from "@material-ui/icons/Delete";
|
||||
@@ -18,7 +18,7 @@ import { logger } from "../../../../../services/monitoring";
|
||||
import { hasRole, Permissions } from "../../../../../utils/roles";
|
||||
import {
|
||||
FleetProvider,
|
||||
useFleetContext,
|
||||
useFleetContext
|
||||
} from "../../../../Contexts/FleetContext";
|
||||
import { useStatusContext } from "../../../../Contexts/StatusContext";
|
||||
import { useUserContext } from "../../../../Contexts/UserContext";
|
||||
|
||||
@@ -180,7 +180,11 @@ const MainForm = () => {
|
||||
<FormControlLabel value="trace" control={<Radio />} label="Trace" />
|
||||
<FormControlLabel value="debug" control={<Radio />} label="Debug" />
|
||||
<FormControlLabel value="info" control={<Radio />} label="Info" />
|
||||
<FormControlLabel value="warning" control={<Radio />} label="Warning" />
|
||||
<FormControlLabel
|
||||
value="warning"
|
||||
control={<Radio />}
|
||||
label="Warning"
|
||||
/>
|
||||
<FormControlLabel value="error" control={<Radio />} label="Error" />
|
||||
<FormControlLabel
|
||||
value="critical"
|
||||
|
||||
Reference in New Issue
Block a user