Fix description in index.html / manifest.json getting double quoted (#131842)

This PR adjusts the quoting of the project description not not apply twice in the index.html / manifest.json of web builds.

*List which issues are fixed by this PR. You must list at least one issue.*
Fixes https://github.com/flutter/flutter/issues/131834

*If you had to change anything in the [flutter/tests] repo, include a link to the migration guide as per the [breaking change policy].*
This commit is contained in:
Navaron Bracke
2023-08-18 04:58:20 +02:00
committed by GitHub
parent a1e3b3dae4
commit 03664d0acb
3 changed files with 49 additions and 2 deletions

View File

@@ -3384,6 +3384,32 @@ void main() {
FeatureFlags: () => TestFeatureFlags(),
Logger: () => logger,
});
testUsingContext('Does not double quote description in index.html on web', () async {
await _createProject(
projectDir,
<String>['--no-pub', '--platforms=web'],
<String>['pubspec.yaml', 'web/index.html'],
);
final String rawIndexHtml = await projectDir.childDirectory('web').childFile('index.html').readAsString();
const String expectedDescription = '<meta name="description" content="A new Flutter project.">';
expect(rawIndexHtml.contains(expectedDescription), isTrue);
});
testUsingContext('Does not double quote description in manifest.json on web', () async {
await _createProject(
projectDir,
<String>['--no-pub', '--platforms=web'],
<String>['pubspec.yaml', 'web/manifest.json'],
);
final String rawManifestJson = await projectDir.childDirectory('web').childFile('manifest.json').readAsString();
const String expectedDescription = '"description": "A new Flutter project."';
expect(rawManifestJson.contains(expectedDescription), isTrue);
});
}
Future<void> _createProject(