refactor: /command hints add tooltips, test for missing hints, script to generate glue code, hints for dm, create, clearcache, discardsession
This commit is contained in:
parent
adba445c33
commit
3c14cbe017
32 changed files with 863 additions and 770 deletions
23
test/command_hint_test.dart
Normal file
23
test/command_hint_test.dart
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
import 'dart:convert';
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
|
||||
import 'utils/test_client.dart';
|
||||
|
||||
void main() async {
|
||||
test('Check for missing /command hints', () async {
|
||||
final translated =
|
||||
jsonDecode(File('assets/l10n/intl_en.arb').readAsStringSync())
|
||||
.keys
|
||||
.where((String k) => k.startsWith('commandHint_'))
|
||||
.map((k) => k.replaceFirst('commandHint_', ''));
|
||||
final commands = (await prepareTestClient()).commands.keys;
|
||||
final missing = commands.where((c) => !translated.contains(c)).toList();
|
||||
|
||||
expect(0, missing.length,
|
||||
reason: 'missing hints for ' +
|
||||
missing.toString() +
|
||||
'\nAdding hints? See scripts/generate_command_hints_glue.sh');
|
||||
});
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue