Skip to content

Commit

Permalink
Functionality tests of filters and searchbar
Browse files Browse the repository at this point in the history
  • Loading branch information
Djmr5 committed Jun 7, 2024
1 parent eb96395 commit 88c161b
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 1 deletion.
26 changes: 26 additions & 0 deletions cypress/e2e/Tests/todo.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,29 @@ describe('Login Page', () => {
cy.url().should('not.include', '/login');
});
});

describe('Main functionalities', () => {

beforeEach(() => {
indexedDB.deleteDatabase('firebaseLocalStorageDb');
cy.viewport('macbook-16');
cy.visit('/login');
cy.get('[data-testid="input-email"]').type('test@g.com');
cy.get('[data-testid="input-password"]').type('123456');
cy.get('button[type="submit"]').click();
});

it('should render home page', () => {
cy.url().should('include', '');
});

it('should filter using searchbar and filters', () => {
cy.url().should('include', '');
cy.wait(15000);
cy.get('[data-testid="search-bar"]').type('Diego J');
cy.get('.agent-info__content__main-info__text__agent-name').contains('Diego Jacobo');
cy.get('[data-testid="search-bar"]').clear();
cy.get('[data-testid="aci-button"]').click();

});
});
2 changes: 1 addition & 1 deletion src/components/SearchBar/SearchBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ const SearchBar: React.FC<SearchBarProps> = ({ placeholder = "Search...", onSear
};

return (
<div className="w-full">
<div className="w-full" data-testid="search-bar">
<div className='flex items-center border border-gray-300 rounded-lg focus-within:border-aci-orange'>
<input
type="text"
Expand Down

0 comments on commit 88c161b

Please sign in to comment.