Rename ClientsGraph loadingState to loadingProps

Signed-off-by: Mcat12 <newtoncat12@yahoo.com>
This commit is contained in:
Mcat12
2018-11-10 11:23:02 -05:00
parent f070ffe208
commit 15813e2124
2 changed files with 6 additions and 6 deletions
+3 -3
View File
@@ -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();