feat: 移除 H5 URL 中的品牌参数和缓存参数;更新测试用例以反映更改

This commit is contained in:
Booker
2026-05-26 20:20:01 +07:00
parent 2eef27a0e1
commit 1e19f5f5f8
3 changed files with 11 additions and 48 deletions

View File

@@ -11,7 +11,7 @@ void main() {
);
});
test('loads the configured H5 root URL with shell launch params', () {
test('loads the configured H5 root URL without shell URL params', () {
const logo = 'data:image/png;base64,abc+/=';
final uri = Uri.parse(
@@ -21,10 +21,10 @@ void main() {
expect(uri.scheme, 'https');
expect(uri.host, 'h5-im.imharry.work');
expect(uri.path, '/');
expect(uri.queryParameters['flutter_shell'], '1');
expect(uri.queryParameters.containsKey('flutter_shell'), isFalse);
expect(uri.queryParameters.containsKey('shell_app_name'), isFalse);
expect(uri.queryParameters.containsKey('shell_app_logo'), isFalse);
expect(uri.queryParameters['shell_cache_bust'], isNotEmpty);
expect(uri.queryParameters.containsKey('shell_cache_bust'), isFalse);
expect(uri.toString(), isNot(contains('%25')));
expect(Uri.splitQueryString(uri.fragment).containsKey('shell_app_logo'),
isFalse);
@@ -34,16 +34,16 @@ void main() {
final uri = Uri.parse(
AppConfig.withFreshShellParams(
'https://h5-im.imharry.work/login?from=runtime&shell_app_name=Old'
'#shell_app_logo=old',
'&flutter_shell=1&shell_cache_bust=1#shell_app_logo=old',
),
);
expect(uri.path, '/login');
expect(uri.queryParameters['from'], 'runtime');
expect(uri.queryParameters['flutter_shell'], '1');
expect(uri.queryParameters.containsKey('flutter_shell'), isFalse);
expect(uri.queryParameters.containsKey('shell_app_name'), isFalse);
expect(uri.queryParameters.containsKey('shell_app_logo'), isFalse);
expect(uri.queryParameters['shell_cache_bust'], isNotEmpty);
expect(uri.queryParameters.containsKey('shell_cache_bust'), isFalse);
expect(Uri.splitQueryString(uri.fragment).containsKey('shell_app_logo'),
isFalse);
});