(frontend) update test descriptions for clarity and consistency

- update tests description
- Corrected minor typos in test descriptions to enhance readability.
- Ensured that all test cases clearly convey their purpose and expected
outcomes.
This commit is contained in:
Nathan Panchout
2025-05-20 10:00:26 +02:00
committed by Anthony LC
parent 17ece3b715
commit 304b3be273
6 changed files with 22 additions and 18 deletions

View File

@@ -242,6 +242,9 @@ export const mockedDocument = async (page: Page, data: object) => {
!request.url().includes('accesses') &&
!request.url().includes('invitations')
) {
const { abilities, ...doc } = data as unknown as {
abilities?: Record<string, unknown>;
};
await route.fulfill({
json: {
id: 'mocked-document-id',
@@ -263,6 +266,7 @@ export const mockedDocument = async (page: Page, data: object) => {
authenticated: ['reader', 'editor'],
restricted: null,
},
...abilities,
},
link_reach: 'restricted',
computed_link_reach: 'restricted',
@@ -272,7 +276,7 @@ export const mockedDocument = async (page: Page, data: object) => {
created_at: '2021-09-01T09:00:00Z',
user_role: 'owner',
user_roles: ['owner'],
...data,
...doc,
},
});
} else {
@@ -339,10 +343,10 @@ export const mockedInvitations = async (page: Page, json?: object) => {
export const mockedAccesses = async (page: Page, json?: object) => {
await page.route('**/accesses/**/', async (route) => {
const request = route.request();
console.log('oui');
if (
request.method().includes('GET') &&
request.url().includes('accesses') &&
request.url().includes('page=')
request.url().includes('accesses')
) {
await route.fulfill({
json: [
@@ -366,6 +370,11 @@ export const mockedAccesses = async (page: Page, json?: object) => {
update: true,
partial_update: true,
retrieve: true,
link_select_options: {
public: ['reader', 'editor'],
authenticated: ['reader', 'editor'],
restricted: null,
},
set_role_to: ['administrator', 'editor'],
},
...json,

View File

@@ -50,7 +50,7 @@ test.describe('Doc grid dnd', () => {
await page.mouse.move(
dropZoneBoundingBox.x + dropZoneBoundingBox.width / 2,
dropZoneBoundingBox.y + dropZoneBoundingBox.height / 2,
{ steps: 10 }, // Rendre le mouvement plus fluide
{ steps: 10 }, // Make the movement smoother
);
const dragOverlay = page.getByTestId('drag-doc-overlay');
@@ -62,7 +62,7 @@ test.describe('Doc grid dnd', () => {
await expect(dragOverlay).toBeHidden();
});
test('it checks cant drop when we have not the minimum role', async ({
test("it checks can't drop when we have not the minimum role", async ({
page,
}) => {
await mockedListDocs(page, data);
@@ -113,7 +113,7 @@ test.describe('Doc grid dnd', () => {
await page.mouse.up();
});
test('it checks cant drag when we have not the minimum role', async ({
test("it checks can't drag when we have not the minimum role", async ({
page,
}) => {
await mockedListDocs(page, data);

View File

@@ -109,11 +109,6 @@ test.describe('Doc Header', () => {
versions_list: true,
versions_retrieve: true,
update: true,
link_select_options: {
public: ['reader', 'editor'],
authenticated: ['reader', 'editor'],
restricted: null,
},
partial_update: true,
retrieve: true,
},

View File

@@ -14,7 +14,7 @@ import {
import { createRootSubPage, createSubPageFromParent } from './sub-pages-utils';
test.describe('Inherited share accesses', () => {
test('Vérifie lhéritage des accès', async ({ page, browserName }) => {
test('it checks inherited accesses', async ({ page, browserName }) => {
await page.goto('/');
const [titleParent] = await createDoc(page, 'root-doc', browserName, 1);
const docTree = page.getByTestId('doc-tree');
@@ -53,7 +53,7 @@ test.describe('Inherited share accesses', () => {
await expect(user.getByText('Owner')).toBeVisible();
});
test('Vérifie le message si il y a un accès hérité', async ({
test('it checks that the highest role is displayed', async ({
page,
browserName,
}) => {
@@ -107,7 +107,7 @@ test.describe('Inherited share accesses', () => {
});
test.describe('Inherited share link', () => {
test('Vérifie si le lien est bien hérité', async ({ page, browserName }) => {
test('it checks if the link is inherited', async ({ page, browserName }) => {
await page.goto('/');
// Create root doc
await createDoc(page, 'root-doc', browserName, 1);
@@ -126,7 +126,7 @@ test.describe('Inherited share link', () => {
// await verifyShareLink(page, 'Connected', 'Reading');
});
test('Vérification du message de warning lorsque les règles de partage diffèrent', async ({
test('it checks warning message when sharing rules differ', async ({
page,
browserName,
}) => {
@@ -155,7 +155,7 @@ test.describe('Inherited share link', () => {
await expect(page.getByText('Sharing rules differ from the')).toBeHidden();
});
test('Vérification des possibilités de liens hérités', async ({
test('it checks inherited link possibilities', async ({
page,
browserName,
}) => {

View File

@@ -113,7 +113,7 @@ test.describe('Document search', () => {
});
test.describe('Sub page search', () => {
test('it check the precense of filters in search modal', async ({
test('it check the presence of filters in search modal', async ({
page,
browserName,
}) => {

View File

@@ -160,7 +160,7 @@ test.describe('Doc Tree', () => {
);
});
test('it detachs a document', async ({ page, browserName }) => {
test('it detaches a document', async ({ page, browserName }) => {
await page.goto('/');
const [docParent] = await createDoc(
page,