Skip to content

Commit

Permalink
added Prelogin component and test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
avinash-mane committed May 21, 2020
1 parent 2de4cd6 commit ce80211
Show file tree
Hide file tree
Showing 8 changed files with 27 additions and 59 deletions.
Binary file added react-frontend/public/assets/images/cat-img.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified react-frontend/public/assets/images/cat-mobile-img.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.

This file was deleted.

This file was deleted.

21 changes: 21 additions & 0 deletions react-frontend/src/login/PreLoginPanelMobileComponent.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import React from "react";
import { Container, Row } from "react-bootstrap";
import LogoComponent from "shared-components/peerly-Logo/LogoComponent";
import LoginTextComponent from "shared-components/login-text-component/LoginTextComponent";
import PreLoginImageComponent from "shared-components/prelogin-image-components/PreLoginImageComponent";

const PreLoginPanelMobileComponent = () => (
<Container className="bg-dark w-100" fluid={true}>
<Row className="h-25 py-5">
<LogoComponent className="text-white" />
</Row>
<Row className="h-50">
<PreLoginImageComponent className="w-100 img-fluid" />
</Row>
<Row className="h-25 py-5">
<LoginTextComponent />
</Row>
</Container>
);

export default PreLoginPanelMobileComponent;
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React from "react";
import { render } from "@testing-library/react";

import LogoComponent from "shared-components/peerly-Logo/LogoComponent";
import PreLoginImageComponent from "shared-components/prelogin-image-components/PreLoginImageComponent"
import PreLoginImageComponent from "shared-components/prelogin-image-components/PreLoginImageComponent";
import LoginTextComponent from "shared-components/login-text-component/LoginTextComponent";

describe("Pre Login component test", () => {
Expand All @@ -12,13 +12,12 @@ describe("Pre Login component test", () => {
expect(testImage).toBeInTheDocument();
});


test("should equal to + Peerly text", () => {
const { getByTestId } = render(<LogoComponent />);
test("should equal to + Peerly text", () => {
const { getByTestId } = render(<LogoComponent />);
expect(getByTestId("peerlyLogoComponent")).toHaveTextContent("+ Peerly");
});

test("should equal to value", () => {
test("should equal to value", () => {
const { getByTestId } = render(
<LoginTextComponent
orgPrimaryCoreValue="Lets Create the Office Positive"
Expand All @@ -29,6 +28,4 @@ test("should equal to value", () => {
"Lets Create the Office Positive positive"
);
});


});
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import { IMG_BASE_PATH } from "constants/appConstants";

const getImagePath = (size) =>
size === "lg"
? `${IMG_BASE_PATH}/cat-img@2x.png`
: `${IMG_BASE_PATH}/cat-img.png`;
? `${IMG_BASE_PATH}/cat-img.png`
: `${IMG_BASE_PATH}/cat-mobile-img.png`;

const PreLoginImageComponent = ({ className, hight, width, size }) => {
const imagePath = React.useMemo(() => getImagePath(size), [size]);
Expand Down

0 comments on commit ce80211

Please sign in to comment.