feat(i18n): Branch protection improvements

- adds a header to indicate creating a new rule
  - test that header is different between new and edit form
- consistently avoids colons in the form
- excludes some accessibility checks that require a global solution for
  forms
This commit is contained in:
Otto Richter 2024-08-18 00:33:50 +02:00
parent 3bbd129270
commit 00276dfc30
4 changed files with 40 additions and 13 deletions

View file

@ -31,6 +31,18 @@ test('repo branch protection settings', async ({browser}, workerInfo) => {
const response = await page.goto('/user2/repo1/settings/branches/edit');
await expect(response?.status()).toBe(200);
// not yet accessible :(
// await validate_form({page}, 'fieldset');
await validate_form({page}, 'fieldset');
// verify header is new
await expect(page.locator('h4')).toContainText('new');
await page.locator('input[name="rule_name"]').fill('testrule');
await page.getByText('Save rule').click();
// verify header is in edit mode
await page.waitForLoadState('networkidle');
await page.getByText('Edit').click();
await expect(page.locator('h4')).toContainText('Protection rules for branch');
// delete the rule for the next test
await page.goBack();
await page.getByText('Delete rule').click();
await page.getByText('Yes').click();
});