From 28c07d35203428b423ed3d275274747a2fa8c586 Mon Sep 17 00:00:00 2001 From: Paulo Gomes da Cruz Junior Date: Thu, 19 Dec 2024 08:53:56 -0800 Subject: [PATCH] fix(SILVA-591): removing timber mark from quick search (#538) --- .../oracle/repository/OpeningRepository.java | 1 - .../Openings/OpeningSearchBar.test.tsx | 4 ++-- .../Openings/OpeningSearchTab.test.tsx | 14 +++++++------- .../Openings/OpeningsSearchBar/index.tsx | 4 ++-- 4 files changed, 11 insertions(+), 12 deletions(-) diff --git a/backend/src/main/java/ca/bc/gov/restapi/results/oracle/repository/OpeningRepository.java b/backend/src/main/java/ca/bc/gov/restapi/results/oracle/repository/OpeningRepository.java index f3290c42..b1ff41cb 100644 --- a/backend/src/main/java/ca/bc/gov/restapi/results/oracle/repository/OpeningRepository.java +++ b/backend/src/main/java/ca/bc/gov/restapi/results/oracle/repository/OpeningRepository.java @@ -254,7 +254,6 @@ LEFT JOIN THE.STOCKING_MILESTONE smfg ON (smfg.STOCKING_STANDARD_UNIT_ID = ssu.S AND o.OPENING_ID = TO_NUMBER(:#{#filter.mainSearchTerm}) ) OR ( o.OPENING_NUMBER = :#{#filter.mainSearchTerm} OR - cboa.TIMBER_MARK = :#{#filter.mainSearchTerm} OR cboa.FOREST_FILE_ID = :#{#filter.mainSearchTerm} ) ) diff --git a/frontend/src/__test__/components/SilvicultureSearch/Openings/OpeningSearchBar.test.tsx b/frontend/src/__test__/components/SilvicultureSearch/Openings/OpeningSearchBar.test.tsx index a4b3c7ff..820d83e4 100644 --- a/frontend/src/__test__/components/SilvicultureSearch/Openings/OpeningSearchBar.test.tsx +++ b/frontend/src/__test__/components/SilvicultureSearch/Openings/OpeningSearchBar.test.tsx @@ -37,7 +37,7 @@ describe("OpeningsSearchBar", () => { // Check if the search input field is present with the correct placeholder text const searchInput = screen.getByPlaceholderText( - "Search by opening ID, opening number, timber mark or file ID" + "Search by opening ID, opening number or file ID" ); expect(searchInput).toBeInTheDocument(); }); @@ -159,7 +159,7 @@ describe("OpeningsSearchBar", () => { // Check if the search input field is present with the correct placeholder text const searchInput = screen.getByPlaceholderText( - "Search by opening ID, opening number, timber mark or file ID" + "Search by opening ID, opening number or file ID" ); await act(async () => await userEvent.type(searchInput, 'tfl47')); await act(async () => await userEvent.keyboard('{enter}')); diff --git a/frontend/src/__test__/components/SilvicultureSearch/Openings/OpeningSearchTab.test.tsx b/frontend/src/__test__/components/SilvicultureSearch/Openings/OpeningSearchTab.test.tsx index 23a91b08..0c28bcda 100644 --- a/frontend/src/__test__/components/SilvicultureSearch/Openings/OpeningSearchTab.test.tsx +++ b/frontend/src/__test__/components/SilvicultureSearch/Openings/OpeningSearchTab.test.tsx @@ -92,7 +92,7 @@ describe('OpeningSearchTab', () => { ); - expect(screen.getByPlaceholderText('Search by opening ID, opening number, timber mark or file ID')).toBeInTheDocument(); + expect(screen.getByPlaceholderText('Search by opening ID, opening number or file ID')).toBeInTheDocument(); }); it('should display search results when search is performed', async () => { @@ -111,7 +111,7 @@ describe('OpeningSearchTab', () => { ); - const searchInput = screen.getByPlaceholderText('Search by opening ID, opening number, timber mark or file ID') as HTMLInputElement; + const searchInput = screen.getByPlaceholderText('Search by opening ID, opening number or file ID') as HTMLInputElement; await act(async () => userEvent.type(searchInput, 'test')); await act(async () => (await screen.findByTestId('search-button')).click()); await act(async () => await screen.findByText('Actions')); @@ -133,7 +133,7 @@ describe('OpeningSearchTab', () => { ); - const searchInput = screen.getByPlaceholderText('Search by opening ID, opening number, timber mark or file ID'); + const searchInput = screen.getByPlaceholderText('Search by opening ID, opening number or file ID'); await act(async () => await userEvent.type(searchInput, 'potato')); await act(async () => (await screen.findByTestId('search-button')).click()); expect(screen.getByText('Results not found')).toBeInTheDocument(); @@ -155,7 +155,7 @@ describe('OpeningSearchTab', () => { )); - const searchInput = screen.getByPlaceholderText('Search by opening ID, opening number, timber mark or file ID'); + const searchInput = screen.getByPlaceholderText('Search by opening ID, opening number or file ID'); await act(async () => await userEvent.type(searchInput, 'test')); await act(async () => (await screen.findByTestId('search-button')).click()); await act(async () => await screen.findByText('Actions')); @@ -182,7 +182,7 @@ describe('OpeningSearchTab', () => { ))); - const searchInput = screen.getByPlaceholderText('Search by opening ID, opening number, timber mark or file ID'); + const searchInput = screen.getByPlaceholderText('Search by opening ID, opening number or file ID'); await act(async () => await userEvent.type(searchInput, 'test')); await act(async () => (await screen.findByTestId('search-button')).click()); await act(async () => await screen.findByText('Actions')); @@ -211,7 +211,7 @@ describe('OpeningSearchTab', () => { )); - const searchInput = screen.getByPlaceholderText('Search by opening ID, opening number, timber mark or file ID'); + const searchInput = screen.getByPlaceholderText('Search by opening ID, opening number or file ID'); await act(async () => await userEvent.type(searchInput, 'test')); await act(async () => (await screen.findByTestId('search-button')).click()); await act(async () => await screen.findByText('Actions')); @@ -238,7 +238,7 @@ describe('OpeningSearchTab', () => { ))); - const searchInput = screen.getByPlaceholderText('Search by opening ID, opening number, timber mark or file ID'); + const searchInput = screen.getByPlaceholderText('Search by opening ID, opening number or file ID'); await act(async () => await userEvent.type(searchInput, 'test')); await act(async () => (await screen.findByTestId('search-button')).click()); await act(async () => await screen.findByText('Actions')); diff --git a/frontend/src/components/SilvicultureSearch/Openings/OpeningsSearchBar/index.tsx b/frontend/src/components/SilvicultureSearch/Openings/OpeningsSearchBar/index.tsx index d7c05079..7450852c 100644 --- a/frontend/src/components/SilvicultureSearch/Openings/OpeningsSearchBar/index.tsx +++ b/frontend/src/components/SilvicultureSearch/Openings/OpeningsSearchBar/index.tsx @@ -66,7 +66,7 @@ const OpeningsSearchBar: React.FC = ({ @@ -75,7 +75,7 @@ const OpeningsSearchBar: React.FC = ({