Skip to content

Commit

Permalink
Close #30 removed unnecessary code and comments. Also added my AI usa…
Browse files Browse the repository at this point in the history
…ge form
  • Loading branch information
ayanahye committed Dec 5, 2023
1 parent 0d9ac4b commit 5691210
Show file tree
Hide file tree
Showing 25 changed files with 12 additions and 31 deletions.
1 change: 0 additions & 1 deletion app/detail/[name]/__tests__/Detail.test.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import {render, screen} from '@testing-library/react';
import Page from "../page";


global.fetch = jest.fn(() => {
let tmp = {
drought_tolerant: false,
Expand Down
2 changes: 0 additions & 2 deletions app/display/page.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ import Taxonomy_list from "../components/taxonomy_list";


function Display() {


return <Taxonomy_list family="Asteraceae"/>
}

Expand Down
6 changes: 0 additions & 6 deletions app/filtering/Filter.css
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,6 @@

}

/* .filterFullArea {
display: flex;
flex-direction: right;
align-items: left;
justify-content: right;
} */
.dropdown-item-custom {
display: flex;
justify-content: left;
Expand Down
16 changes: 4 additions & 12 deletions app/filtering/__tests__/Filter.test.jsx
Original file line number Diff line number Diff line change
@@ -1,15 +1,11 @@
import React from 'react';
import {render, fireEvent, screen, queryByText, within} from '@testing-library/react';
import {render, fireEvent, screen, within} from '@testing-library/react';
import '@testing-library/jest-dom/extend-expect';
import Filter from '../filter';

import userEvent from '@testing-library/user-event';
import Page from '../page';
import {http, HttpResponse} from 'msw'
import {setupServer} from "msw/node";
import {perenual_detail_test_value} from "../../globalTypes";


// integration test for filter page that it correctly integrates with netlify functions
const server = setupServer(
http.get('/.netlify/functions/filter', async ({request}) => {
Expand All @@ -24,12 +20,9 @@ afterAll(() => server.close())
describe("filter page integrates with API", () => {
test('Clicking dropdown option displays correct information', async () => {
render(<Filter speciesList={perenual_detail_test_value} />);


const navigationFilterBox = screen.getByTestId('navigationfilterbox');

const checkBox = screen.getByTestId('checkbox-option1-common_name');
fireEvent.click(checkBox);

const checkBox = screen.getByTestId('checkbox-option1-common_name');
fireEvent.click(checkBox);

const informationDiv = screen.getByTestId('scroll-object1');

Expand Down Expand Up @@ -211,7 +204,6 @@ describe("Options shows in display div", () => {
// unit test
it('will render "Current plant = No name yet" and filters are empty on render when speciesList is empty or null.', () => {
render(<Filter />);

const currentPlantName = screen.getByText(/Current plant = No name yet/i);
expect(currentPlantName).toBeInTheDocument();

Expand Down
2 changes: 0 additions & 2 deletions app/filtering/page.jsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
'use client'
import { useEffect, useState } from "react";

import React from 'react'
import Filter from './filter';
import "./Filter.css";
import Data from '../SampleData.json'

function Filtering(props) {

Expand Down
2 changes: 1 addition & 1 deletion app/identify/connection.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"use server"

import {plantnet, plantnet_test_value} from "@/app/globalTypes";
import {plantnet} from "@/app/globalTypes";

export async function postData(form: FormData): Promise<plantnet> {
//see .env file in root folder
Expand Down
3 changes: 0 additions & 3 deletions app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,8 @@ import Image from "next/image";
import Link from 'next/link';
import {useRouter} from 'next/navigation';


const inter = Inter({subsets: ['latin']})


export default function RootLayout({children,}: {
children: React.ReactNode
}) {
Expand All @@ -25,7 +23,6 @@ export default function RootLayout({children,}: {
//This is the layout, the master of the page, which appears as the outer border on each page.
//bootstrap has been referenced globally, do not import it again.

//do not delete this bootstrap js plz!!!!!
return (
<html lang="en">
<Script src='/bootstrap/bootstrap.bundle.min.js'></Script>
Expand Down
2 changes: 1 addition & 1 deletion app/not-found.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export default function NotFound() {
<div className="text">
<h1 className="error">404 - Plant Not Found</h1>

<p>This is most likely due to our API not returning any reults. This flower does not exist in our APIs database. Please try another search or another image. We apologize for the inconvenience this may have caused.</p>
<p id="body-text">This is most likely due to our API not returning any reults. This flower does not exist in our APIs database. Please try another search or another image. We apologize for the inconvenience this may have caused.</p>

</div>
<button id="bigger" type="button" className="btn btn-success"><Link className="link" href="/">Return Home</Link></button>
Expand Down
8 changes: 6 additions & 2 deletions app/notfound.css
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
}

.error {
font-size: 5em;
font-size: 50px;
color: green;
}

Expand All @@ -47,8 +47,12 @@
}

#bigger {
font-size: 30px;
font-size: 20px;
margin-top: 20px;
margin-bottom: 20px;
}

#body-text {
font-size: 20px;
}

1 change: 0 additions & 1 deletion app/search/connection.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
"use server"

import {perenual_search} from "@/app/globalTypes";

// :something is used for define data type, ignore them if you don't understand
Expand Down
Binary file not shown.
Binary file removed public/images/bg1.jpg
Binary file not shown.
Binary file removed public/images/bg1.webp
Binary file not shown.
Binary file removed public/images/bg2.png
Binary file not shown.
Binary file removed public/images/bg2.webp
Binary file not shown.
Binary file removed public/images/bg3.png
Binary file not shown.
Binary file removed public/images/bg3.webp
Binary file not shown.
Binary file removed public/images/bg4.png
Binary file not shown.
Binary file removed public/images/bg4.webp
Binary file not shown.
Binary file removed public/images/bg5.png
Binary file not shown.
Binary file removed public/images/bg5.webp
Binary file not shown.

0 comments on commit 5691210

Please sign in to comment.