(app-desk) integrate teams panel design

- Integrate teams panel design based from the mockup.
- List teams from the API.
This commit is contained in:
Anthony LC
2024-02-13 16:03:47 +01:00
committed by Anthony LC
parent 148ea81aa9
commit 4f0465fd32
26 changed files with 453 additions and 135 deletions

View File

@@ -1,29 +0,0 @@
import { expect, test } from '@playwright/test';
import { keyCloakSignIn } from './common';
test.beforeEach(async ({ page }) => {
await page.goto('/');
await keyCloakSignIn(page);
});
test.describe('App', () => {
test('should display the main elements', async ({ page }) => {
await expect(page.locator('header').first()).toContainText('Desk');
await expect(page.getByLabel('Team name')).toBeVisible();
});
test('creates 2 teams and displayed them', async ({ page }) => {
await page.getByLabel('Team name').fill('My new team');
await page.click('button:has-text("Create Team")');
await page.getByLabel('Team name').fill('My second new team');
await page.click('button:has-text("Create Team")');
await expect(
page.locator('li').getByText('My new team').first(),
).toBeVisible();
await expect(
page.locator('li').getByText('My second new team').first(),
).toBeVisible();
});
});

View File

@@ -24,7 +24,7 @@ test.describe('Header', () => {
);
await expect(header.locator('h2').getByText('Desk')).toHaveCSS(
'font-family',
'marianne',
/Marianne/i,
);
await expect(

View File

@@ -10,7 +10,9 @@ test.beforeEach(async ({ page }) => {
test.describe('Language', () => {
test('checks the language picker', async ({ page }) => {
await expect(
page.locator('h1').first().getByText('Hello Desk !'),
page.getByRole('button', {
name: 'Create a new team',
}),
).toBeVisible();
const header = page.locator('header').first();
@@ -19,7 +21,9 @@ test.describe('Language', () => {
await expect(header.getByRole('combobox').getByText('FR')).toBeVisible();
await expect(
page.locator('h1').first().getByText('Bonjour Desk !'),
page.getByRole('button', {
name: 'Créer un nouveau groupe',
}),
).toBeVisible();
});
});

View File

@@ -46,7 +46,9 @@ test.describe('Menu', () => {
page,
}) => {
await expect(
page.locator('h1').first().getByText('Hello Desk !'),
page.getByRole('button', {
name: 'Create a new team',
}),
).toBeVisible();
const menu = page.locator('menu').first();
@@ -57,11 +59,15 @@ test.describe('Menu', () => {
// eslint-disable-next-line playwright/no-conditional-in-test
if (isDefault) {
await expect(
page.locator('h1').first().getByText('Hello Desk !'),
page.getByRole('button', {
name: 'Create a new team',
}),
).toBeVisible();
} else {
await expect(
page.locator('h1').first().getByText('Hello Desk !'),
page.getByRole('button', {
name: 'Create a new team',
}),
).toBeHidden();
const reg = new RegExp(name.toLowerCase());

View File

@@ -0,0 +1,34 @@
import { expect, test } from "@playwright/test";
import { keyCloakSignIn } from "./common";
test.beforeEach(async ({ page }) => {
await page.goto("/");
await keyCloakSignIn(page);
});
test.describe("Teams", () => {
test("checks all the elements are visible", async ({ page }) => {
const panel = page.getByLabel("Teams panel").first();
await expect(panel.getByText("Recents")).toBeVisible();
await expect(
panel.getByRole("button", {
name: "Sort the teams",
}),
).toBeVisible();
await expect(
panel.getByRole("button", {
name: "Add a team",
}),
).toBeVisible();
await expect(
panel.getByText(
'Create your first team by clicking on the "Create a new team" button.',
),
).toBeVisible();
});
});