mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2026-03-13 10:22:08 +08:00
chore(playwright): resolve axe violations with setContent (#28592)
Issue number: N/A --------- <!-- Please do not submit updates to dependencies unless it fixes an issue. --> <!-- Please try to limit your pull request to one type (bugfix, feature, etc). Submit multiple pull requests if needed. --> ## What is the current behavior? <!-- Please describe the current behavior that you are modifying. --> When using `.setContent`, the initial page template is lacking key metadata that will result in AXE violations. ## What is the new behavior? <!-- Please describe the behavior or changes that are being added by this PR. --> - Adds a default `lang` to the `html` document root - Adds a default `title` tag ## Does this introduce a breaking change? - [ ] Yes - [x] No <!-- If this introduces a breaking change, please describe the impact and migration path for existing applications below. --> ## Other information <!-- Any other information that is important to this PR such as screenshots of how the component looks before and after the change. -->
This commit is contained in:
@@ -32,8 +32,9 @@ export const setContent = async (page: Page, html: string, testInfo: TestInfo, o
|
||||
|
||||
const output = `
|
||||
<!DOCTYPE html>
|
||||
<html dir="${direction}">
|
||||
<html dir="${direction}" lang="en">
|
||||
<head>
|
||||
<title>Ionic Playwright Test</title>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0" />
|
||||
<link href="${baseUrl}/css/ionic.bundle.css" rel="stylesheet" />
|
||||
|
||||
Reference in New Issue
Block a user