✨(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:
committed by
Anthony LC
parent
17ece3b715
commit
304b3be273
@@ -242,6 +242,9 @@ export const mockedDocument = async (page: Page, data: object) => {
|
|||||||
!request.url().includes('accesses') &&
|
!request.url().includes('accesses') &&
|
||||||
!request.url().includes('invitations')
|
!request.url().includes('invitations')
|
||||||
) {
|
) {
|
||||||
|
const { abilities, ...doc } = data as unknown as {
|
||||||
|
abilities?: Record<string, unknown>;
|
||||||
|
};
|
||||||
await route.fulfill({
|
await route.fulfill({
|
||||||
json: {
|
json: {
|
||||||
id: 'mocked-document-id',
|
id: 'mocked-document-id',
|
||||||
@@ -263,6 +266,7 @@ export const mockedDocument = async (page: Page, data: object) => {
|
|||||||
authenticated: ['reader', 'editor'],
|
authenticated: ['reader', 'editor'],
|
||||||
restricted: null,
|
restricted: null,
|
||||||
},
|
},
|
||||||
|
...abilities,
|
||||||
},
|
},
|
||||||
link_reach: 'restricted',
|
link_reach: 'restricted',
|
||||||
computed_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',
|
created_at: '2021-09-01T09:00:00Z',
|
||||||
user_role: 'owner',
|
user_role: 'owner',
|
||||||
user_roles: ['owner'],
|
user_roles: ['owner'],
|
||||||
...data,
|
...doc,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
@@ -339,10 +343,10 @@ export const mockedInvitations = async (page: Page, json?: object) => {
|
|||||||
export const mockedAccesses = async (page: Page, json?: object) => {
|
export const mockedAccesses = async (page: Page, json?: object) => {
|
||||||
await page.route('**/accesses/**/', async (route) => {
|
await page.route('**/accesses/**/', async (route) => {
|
||||||
const request = route.request();
|
const request = route.request();
|
||||||
|
console.log('oui');
|
||||||
if (
|
if (
|
||||||
request.method().includes('GET') &&
|
request.method().includes('GET') &&
|
||||||
request.url().includes('accesses') &&
|
request.url().includes('accesses')
|
||||||
request.url().includes('page=')
|
|
||||||
) {
|
) {
|
||||||
await route.fulfill({
|
await route.fulfill({
|
||||||
json: [
|
json: [
|
||||||
@@ -366,6 +370,11 @@ export const mockedAccesses = async (page: Page, json?: object) => {
|
|||||||
update: true,
|
update: true,
|
||||||
partial_update: true,
|
partial_update: true,
|
||||||
retrieve: true,
|
retrieve: true,
|
||||||
|
link_select_options: {
|
||||||
|
public: ['reader', 'editor'],
|
||||||
|
authenticated: ['reader', 'editor'],
|
||||||
|
restricted: null,
|
||||||
|
},
|
||||||
set_role_to: ['administrator', 'editor'],
|
set_role_to: ['administrator', 'editor'],
|
||||||
},
|
},
|
||||||
...json,
|
...json,
|
||||||
|
|||||||
@@ -50,7 +50,7 @@ test.describe('Doc grid dnd', () => {
|
|||||||
await page.mouse.move(
|
await page.mouse.move(
|
||||||
dropZoneBoundingBox.x + dropZoneBoundingBox.width / 2,
|
dropZoneBoundingBox.x + dropZoneBoundingBox.width / 2,
|
||||||
dropZoneBoundingBox.y + dropZoneBoundingBox.height / 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');
|
const dragOverlay = page.getByTestId('drag-doc-overlay');
|
||||||
@@ -62,7 +62,7 @@ test.describe('Doc grid dnd', () => {
|
|||||||
await expect(dragOverlay).toBeHidden();
|
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,
|
page,
|
||||||
}) => {
|
}) => {
|
||||||
await mockedListDocs(page, data);
|
await mockedListDocs(page, data);
|
||||||
@@ -113,7 +113,7 @@ test.describe('Doc grid dnd', () => {
|
|||||||
await page.mouse.up();
|
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,
|
page,
|
||||||
}) => {
|
}) => {
|
||||||
await mockedListDocs(page, data);
|
await mockedListDocs(page, data);
|
||||||
|
|||||||
@@ -109,11 +109,6 @@ test.describe('Doc Header', () => {
|
|||||||
versions_list: true,
|
versions_list: true,
|
||||||
versions_retrieve: true,
|
versions_retrieve: true,
|
||||||
update: true,
|
update: true,
|
||||||
link_select_options: {
|
|
||||||
public: ['reader', 'editor'],
|
|
||||||
authenticated: ['reader', 'editor'],
|
|
||||||
restricted: null,
|
|
||||||
},
|
|
||||||
partial_update: true,
|
partial_update: true,
|
||||||
retrieve: true,
|
retrieve: true,
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ import {
|
|||||||
import { createRootSubPage, createSubPageFromParent } from './sub-pages-utils';
|
import { createRootSubPage, createSubPageFromParent } from './sub-pages-utils';
|
||||||
|
|
||||||
test.describe('Inherited share accesses', () => {
|
test.describe('Inherited share accesses', () => {
|
||||||
test('Vérifie l’héritage des accès', async ({ page, browserName }) => {
|
test('it checks inherited accesses', async ({ page, browserName }) => {
|
||||||
await page.goto('/');
|
await page.goto('/');
|
||||||
const [titleParent] = await createDoc(page, 'root-doc', browserName, 1);
|
const [titleParent] = await createDoc(page, 'root-doc', browserName, 1);
|
||||||
const docTree = page.getByTestId('doc-tree');
|
const docTree = page.getByTestId('doc-tree');
|
||||||
@@ -53,7 +53,7 @@ test.describe('Inherited share accesses', () => {
|
|||||||
await expect(user.getByText('Owner')).toBeVisible();
|
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,
|
page,
|
||||||
browserName,
|
browserName,
|
||||||
}) => {
|
}) => {
|
||||||
@@ -107,7 +107,7 @@ test.describe('Inherited share accesses', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
test.describe('Inherited share link', () => {
|
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('/');
|
await page.goto('/');
|
||||||
// Create root doc
|
// Create root doc
|
||||||
await createDoc(page, 'root-doc', browserName, 1);
|
await createDoc(page, 'root-doc', browserName, 1);
|
||||||
@@ -126,7 +126,7 @@ test.describe('Inherited share link', () => {
|
|||||||
// await verifyShareLink(page, 'Connected', 'Reading');
|
// 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,
|
page,
|
||||||
browserName,
|
browserName,
|
||||||
}) => {
|
}) => {
|
||||||
@@ -155,7 +155,7 @@ test.describe('Inherited share link', () => {
|
|||||||
await expect(page.getByText('Sharing rules differ from the')).toBeHidden();
|
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,
|
page,
|
||||||
browserName,
|
browserName,
|
||||||
}) => {
|
}) => {
|
||||||
|
|||||||
@@ -113,7 +113,7 @@ test.describe('Document search', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
test.describe('Sub page 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,
|
page,
|
||||||
browserName,
|
browserName,
|
||||||
}) => {
|
}) => {
|
||||||
|
|||||||
@@ -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('/');
|
await page.goto('/');
|
||||||
const [docParent] = await createDoc(
|
const [docParent] = await createDoc(
|
||||||
page,
|
page,
|
||||||
|
|||||||
Reference in New Issue
Block a user