Commit 8f6e2e06 authored by DESKTOP-J7QTMBR\mikke's avatar DESKTOP-J7QTMBR\mikke
Browse files

test merged

parent 3e4f462a
......@@ -3,10 +3,6 @@ describe('When searching', () => {
cy.visit('http://localhost:3001/');
})
it("Find search field", () => {
cy.get(".searchbar > input")
.type("Norway")
......@@ -14,7 +10,4 @@ it("Find search field", () => {
cy.get("#buttonclick").click();
cy.get('#card').first().should('include.text', 'Norway');
});
});
\ No newline at end of file
import { fireEvent, getByTestId, render,screen } from "@testing-library/react";
import userEvent from "@testing-library/user-event";
import React, { useState } from "react";
import App from "../../App";
import { ContinentCheckbox } from "./ContinentCheckbox";
describe("<ContinentCheckbox />", () => {
test('render component', () => {
render(<ContinentCheckbox />);
const asia = screen.getByText("Asia");
expect(asia).toBeInTheDocument();
expect(asia).not.toBeChecked();
userEvent.click(asia);
//expect(asia.getAttribute).toBeFalsy;
});
})
......@@ -17,11 +17,11 @@ export const Filter: FunctionComponent<IProps> = ({onButtonClick, filterClick})
<Button variant="secondary"
onClick={()=> onButtonClick(["name", "ASC"])}>Name abc</Button>
<Button variant="secondary"
onClick={()=> onButtonClick(["name", "DESC"])}>Name cba</Button>
onClick={()=> onButtonClick(["name", "DESC"])}>Name xyz</Button>
<Button variant="secondary"
onClick={()=> onButtonClick(["capital", "ASC"])}>Capital abc</Button>
<Button variant="secondary"
onClick={()=> onButtonClick(["capital", "DESC"])}>Capital cba</Button>
onClick={()=> onButtonClick(["capital", "DESC"])}>Capital xyz</Button>
</div>
<div className={"ContinentCheckbox"}>
<ContinentCheckbox handleClick={filterClick}/>
......
import React from "react";
import { fireEvent, render } from "@testing-library/react";
import { render } from "@testing-library/react";
import { Searchbar } from './searchbar';
import App from "../../App";
import { Provider } from "react-redux";
import { searchbarStore } from "./SearchbarStore";
test('FocusInput matches snapshot', () => {
const { container } = render(<Searchbar />)
......@@ -18,31 +12,9 @@ import { searchbarStore } from "./SearchbarStore";
const items =["Norway", "India", "Germany"];
describe("<searchbar />", () => {
// test('Check placholer value', () => {
// const container = render(<Searchbar />)
// expect(container.find('.searchbar').at(0).props().placeholder).toEqual("Enter Country")
});
});
});
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment