Files
gitea/tests/e2e/pull-merge-box.test.ts
T
silverwind b7c1fb2a39 enhance: enable DEFAULT_DELETE_BRANCH_AFTER_MERGE by default for new repos (#39975)
Switch the `DEFAULT_DELETE_BRANCH_AFTER_MERGE` default from
https://github.com/go-gitea/gitea/pull/36917 to `true`, saving users a
click on merge for the most common action that deletes the PR branch on
merge.

Docs: https://gitea.com/gitea/docs/pulls/608
2026-11-05 18:26:32 +00:00

24 lines
1.1 KiB
TypeScript

import {env} from 'node:process';
import {test, expect} from '@playwright/test';
import {apiCreateFiles, apiCreatePR, apiCreateRepo, assertNoJsError, login, randomString} from './utils.ts';
const owner = env.GITEA_TEST_E2E_USER;
test('merge box merges a pull request', async ({page, request}) => {
const repo = `e2e-merge-box-${randomString(8)}`;
const createPR = (async () => {
await apiCreateRepo(request, {name: repo});
await apiCreateFiles(request, owner, repo, [{path: 'feat.txt', content: 'feature\n'}], {branch: 'main', newBranch: 'feat'});
return apiCreatePR(request, owner, repo, 'feat', 'main', 'merge box test');
})();
const [index] = await Promise.all([createPR, login(page)]);
await page.goto(`/${owner}/${repo}/pulls/${index}`, {waitUntil: 'commit'});
// expand the merge form, then submit the merge
await page.getByRole('button', {name: 'Create merge commit'}).click();
await page.locator('form.form-fetch-action').getByRole('button', {name: 'Create merge commit'}).click();
await expect(page.getByText('Merged', {exact: true})).toBeVisible();
await assertNoJsError(page);
});