Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Featurebookingstate #50

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion src/components/Bookings/Bookings.jsx
Original file line number Diff line number Diff line change
@@ -1,17 +1,23 @@
import React, { useState } from 'react';
import Search from "@/components/Search/Search";
import SearchResult from "../SearchResult/SearchResult";
import FakeBookings from '@/data/fakeBookings.json';

// import SearchResults from "@/componentsSearchResults.js";
// import FakeBookings from "@/data/fakeBookings.json";

const Bookings = () => {

const [bookings, setBookings] = useSatet(FakeBookings);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's a little typo here :)


const search = (searchVal) => {
console.info("TO DO!", searchVal);
};

return (
<main className="bookings">
<Search search={search} />
<SearchResult />
<SearchResult bookings={bookings} />
</main>
);
};
Expand Down
12 changes: 6 additions & 6 deletions src/components/Bookings/Bookings.test.jsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { describe, it, expect } from "vitest";
import { render, screen } from "@testing-library/react";
import Bookings from "./Bookings.jsx";
import { describe, it, expect } from 'vitest';
import { render, screen } from '@testing-library/react';
import Bookings from './Bookings.jsx';

describe("Bookings Component", () => {
it("renders a main element", () => {
describe('Bookings Component', () => {
it('renders a main element', () => {
render(<Bookings />);
const mainElement = screen.getByRole("main");
const mainElement = screen.getByRole('main');
expect(mainElement).toBeInTheDocument();
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good to see you've done a test here but do remember to also check it in the browser!

});
});