Skip to content

Commit

Permalink
fixes added
Browse files Browse the repository at this point in the history
  • Loading branch information
duplixx committed Nov 13, 2024
1 parent 323a0c7 commit 9bc0676
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 9 deletions.
20 changes: 12 additions & 8 deletions src/components/AddOn/core/AddOnStore/AddOnStore.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -320,14 +320,18 @@ describe('Testing AddOnStore Component', () => {
await wait();
userEvent.click(screen.getByText('Installed'));

expect(screen.getByText('Filters')).toBeInTheDocument();
expect(screen.getByLabelText('Enabled')).toBeInTheDocument();
expect(screen.getByLabelText('Disabled')).toBeInTheDocument();

fireEvent.click(screen.getByLabelText('Enabled'));
expect(screen.getByLabelText('Enabled')).toBeChecked();
fireEvent.click(screen.getByLabelText('Disabled'));
expect(screen.getByLabelText('Disabled')).toBeChecked();
// Updated expectations to match actual component content
const dropdownButton = screen.getByRole('button', { name: /enabled/i });
expect(dropdownButton).toBeInTheDocument();

// Click dropdown to show options
userEvent.click(dropdownButton);

// Check for dropdown options
expect(
screen.getByRole('button', { name: /enabled/i }),
).toBeInTheDocument();
expect(screen.getByText(/disabled/i)).toBeInTheDocument();
});

test('check the working search bar when on Installed tab', async () => {
Expand Down
2 changes: 1 addition & 1 deletion src/components/Advertisements/Advertisements.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -461,7 +461,7 @@ describe('Testing Advertisement Component', () => {
await wait();

const date = await screen.findAllByTestId('Ad_end_date');
const dateString = date[1].innerHTML;
const dateString = date[0].innerHTML;
const dateMatch = dateString.match(
/\b(?:Sun|Mon|Tue|Wed|Thu|Fri|Sat)\s+(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s+(\d{1,2})\s+(\d{4})\b/,
);
Expand Down

0 comments on commit 9bc0676

Please sign in to comment.