0
0
Fork 0
mirror of https://codeberg.org/forgejo/forgejo.git synced 2025-02-07 18:56:35 -05:00
forgejo/tests/e2e/git-notes.test.e2e.ts
Beowulf d68e0d3e39 fix(ui): hide git note add button for commit if commit already has a note (#6613)
Regression from f5c0570533

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/6613
Reviewed-by: 0ko <0ko@noreply.codeberg.org>
Co-authored-by: Beowulf <beowulf@beocode.eu>
Co-committed-by: Beowulf <beowulf@beocode.eu>
2025-01-18 19:39:42 +00:00

30 lines
1 KiB
TypeScript

// @ts-check
import {expect} from '@playwright/test';
import {save_visual, test} from './utils_e2e.ts';
test.use({user: 'user2'});
test('Change git note', async ({page}) => {
let response = await page.goto('/user2/repo1/commit/65f1bf27bc3bf70f64657658635e66094edbcb4d');
expect(response?.status()).toBe(200);
// An add button should not be present, because the commit already has a commit note
await expect(page.locator('#commit-notes-add-button')).toHaveCount(0);
await page.locator('#commit-notes-edit-button').click();
let textarea = page.locator('textarea[name="notes"]');
await expect(textarea).toBeVisible();
await textarea.fill('This is a new note');
await save_visual(page);
await page.locator('#notes-save-button').click();
await save_visual(page);
response = await page.goto('/user2/repo1/commit/65f1bf27bc3bf70f64657658635e66094edbcb4d');
expect(response?.status()).toBe(200);
textarea = page.locator('textarea[name="notes"]');
await expect(textarea).toHaveText('This is a new note');
await save_visual(page);
});