Skip to content

Commit

Permalink
Fixed undo clicked test + set the delete and undelete toasts for task…
Browse files Browse the repository at this point in the history
… always top right
  • Loading branch information
bobalazek committed Jan 2, 2024
1 parent b11db47 commit 47daca2
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
4 changes: 3 additions & 1 deletion apps/web-e2e/src/e2e/features/tasks/tasks-tasks.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -143,9 +143,11 @@ describe('tasks-tasks.cy.ts', () => {
.contains('Delete')
.click();

cy.getToastsContainer().find('button').contains('Undo').click();
cy.getToastsContainer().find('button').contains('Undo').click({ force: true });

cy.getBySel('tasks--task--name').contains('My new task');

cy.hasToastWithText('The task was successfully undeleted!');
});

it('should open expanded edit options for a task', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ const TaskItemActions = memo(

sonnerToast.success(`Task "${task.name}" Undeleted`, {
description: 'The task was successfully undeleted!',
position: 'top-right',
});
} catch (error) {
// We are already handling the error by showing a toast message inside in the fetch function
Expand All @@ -79,6 +80,7 @@ const TaskItemActions = memo(
label: 'Undo',
onClick: (event) => onUndeleteButtonClick(event),
},
position: 'top-right',
});
} catch (error) {
// We are already handling the error by showing a toast message inside in the fetch function
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ function TasksForm() {

if (!selectedList) {
sonnerToast.error('Oops!', {
position: 'top-right',
description:
'Oh dear, or dear. Did you, by any chance, forget to select a list? Awkward, right?',
position: 'top-right',
});

return;
Expand All @@ -29,9 +29,9 @@ function TasksForm() {
const finalName = name.trim();
if (finalName === '') {
sonnerToast.error('Oops!', {
position: 'top-right',
description:
'Oh dear, or dear. Did you, by any chance, forget to type something? Awkward, right?',
position: 'top-right',
});

return;
Expand Down

0 comments on commit 47daca2

Please sign in to comment.