mirror of
https://github.com/gosticks/web.git
synced 2026-10-06 14:47:32 +00:00
Rename ClientsGraph loadingState to loadingProps
Signed-off-by: Mcat12 <newtoncat12@yahoo.com>
This commit is contained in:
@@ -192,7 +192,7 @@ export const transformData = data => {
|
||||
*
|
||||
* @returns {*} the loading props
|
||||
*/
|
||||
export const loadingState = () => ({
|
||||
export const loadingProps = () => ({
|
||||
loading: true,
|
||||
labels: [],
|
||||
datasets: []
|
||||
@@ -207,11 +207,11 @@ export default props => (
|
||||
interval: 10 * 60 * 1000
|
||||
}}
|
||||
renderInitial={() => (
|
||||
<TranslatedClientsGraph {...loadingState()} {...props} />
|
||||
<TranslatedClientsGraph {...loadingProps()} {...props} />
|
||||
)}
|
||||
renderOk={data => (
|
||||
<TranslatedClientsGraph {...transformData(data)} {...props} />
|
||||
)}
|
||||
renderErr={() => <TranslatedClientsGraph {...loadingState()} {...props} />}
|
||||
renderErr={() => <TranslatedClientsGraph {...loadingProps()} {...props} />}
|
||||
/>
|
||||
);
|
||||
|
||||
@@ -13,7 +13,7 @@ import { shallow } from "enzyme";
|
||||
import {
|
||||
TranslatedClientsGraph,
|
||||
transformData,
|
||||
loadingState
|
||||
loadingProps
|
||||
} from "./ClientsGraph";
|
||||
|
||||
const fakeData = {
|
||||
@@ -39,14 +39,14 @@ const fakeData = {
|
||||
};
|
||||
|
||||
it("shows loading indicator correctly", () => {
|
||||
const wrapper = shallow(<TranslatedClientsGraph {...loadingState()} />);
|
||||
const wrapper = shallow(<TranslatedClientsGraph {...loadingProps()} />);
|
||||
|
||||
expect(wrapper.children(".card-img-overlay")).toExist();
|
||||
});
|
||||
|
||||
it("hides loading indicator correctly", async () => {
|
||||
const wrapper = shallow(
|
||||
<TranslatedClientsGraph {...loadingState()} loading={false} />
|
||||
<TranslatedClientsGraph {...loadingProps()} loading={false} />
|
||||
);
|
||||
|
||||
expect(wrapper.children(".card-img-overlay")).not.toExist();
|
||||
|
||||
Reference in New Issue
Block a user