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

Search bar toggle functionality #194

Merged
merged 4 commits into from
Nov 4, 2024
Merged
Show file tree
Hide file tree
Changes from 3 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
20 changes: 16 additions & 4 deletions __tests__/HomeScreen.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,24 @@ afterEach(() => {
});

describe('HomeScreen', () => {
it('renders without crashing', () => {
it('renders toggle search bar', async () => {
const routeMock = { params: { untitledNumber: 1 } };
const { getByTestId } = render(<HomeScreen route={routeMock as any} />);

const toggleButton = await waitFor(() => getByTestId('searchButton'));
expect(toggleButton).toBeTruthy();
});

// Check if the RichEditor is rendered
expect(getByTestId('searchBar')).toBeTruthy();
it('toggle search bar visibility', async () => {
AmarHadzic marked this conversation as resolved.
Show resolved Hide resolved
const routeMock = { params: { untitledNumber: 1 } };
const { getByTestId } = render(<HomeScreen route={routeMock as any} />);

const toggleButton = await waitFor(() => getByTestId('searchButton'));
fireEvent.press(toggleButton);

const searchBar = await waitFor(() => getByTestId('searchBar'));
expect(searchBar).toBeTruthy();
});

});
});

Loading
Loading