+
+
{connectionIssue && (
diff --git a/frontend/src/api/apiService.ts b/frontend/src/api/apiService.ts
index 391cd7fd..8861dfe1 100644
--- a/frontend/src/api/apiService.ts
+++ b/frontend/src/api/apiService.ts
@@ -64,6 +64,5 @@ export const login = async (username: string, password: string) => {
},
}
);
- console.log(response);
return response;
};
diff --git a/frontend/src/components/Header.test.tsx b/frontend/src/components/Header.test.tsx
new file mode 100644
index 00000000..4a1e3ca8
--- /dev/null
+++ b/frontend/src/components/Header.test.tsx
@@ -0,0 +1,9 @@
+import { render, screen } from '@testing-library/react';
+import Header from './Header';
+
+describe('Header', () => {
+ it('renders correctly', () => {
+ render(
);
+ expect(screen.getByTestId('app-logo')).toBeInTheDocument();
+ });
+});
\ No newline at end of file
diff --git a/frontend/src/components/Header.tsx b/frontend/src/components/Header.tsx
index ebe36abd..dbd3d3bf 100644
--- a/frontend/src/components/Header.tsx
+++ b/frontend/src/components/Header.tsx
@@ -1,7 +1,7 @@
const Header = () => {
return (
-
+
);
};
diff --git a/playwright/tests/note.spec.ts b/playwright/tests/note.spec.ts
index 98b1a5bd..37596987 100644
--- a/playwright/tests/note.spec.ts
+++ b/playwright/tests/note.spec.ts
@@ -18,7 +18,7 @@ test.beforeAll(async ({ browser }, { timeout }) => {
});
test('Notes App e2e flow', async () => {
- await test.step('Should see the login form', async () => {
+ await test.step('Should be able to login with valid user credentials', async () => {
await expect(page.getByPlaceholder('Username')).toBeVisible();
await expect(page.getByPlaceholder('Password')).toBeVisible();
@@ -96,5 +96,12 @@ test('Notes App e2e flow', async () => {
await expect(page.getByTestId('note-content').first()).not.toHaveText(
NOTE_CONTENT
);
+ // Close the modal
+ await page.locator('button[class*="modal-close"]').click();
+ });
+
+ await test.step('Should be able to logout', async () => {
+ await page.getByRole('button', { name: 'Logout' }).click();
+ await expect(page.getByPlaceholder('Username')).toBeVisible();
});
});