test(client): 用例名统一为 should_<期望>_when_<条件>(155/155)
为什么:红线第 8 条门禁立即生效,要求 Flutter 测试命名合规;此前 155 条用例名是英文自然语言 或中文描述,合规数 0/155,属存量欠账,按"先补齐再上新功能"在本批处理。 - 25 个测试文件、155 条用例改名,按「文件 + 旧名」精确定位,每条断言命中恰好 1 次才替换 - 只改名字字面量:改动行 155 删 + 155 增,无一行不含字符串字面量(断言与用例体零改动) - 门禁:dart analyze lib test = No issues found;flutter test = 155 全过
This commit is contained in:
1 parent
1853e1845c
commit
0e5d550b50
25 files changed
+155
-155
No files matched your search
@@ -55,7 +55,7 @@ void main() {
|
||||
TestWidgetsFlutterBinding.ensureInitialized();
|
||||
|
||||
group('displayEpisode', () {
|
||||
test('falls back until a number is picked for that drama', () {
|
||||
test('should_fall_back_until_episode_number_is_picked_for_that_drama_when_resolving', () {
|
||||
final logic = _logic(FakeWatchHistory());
|
||||
final drama = _drama('signal');
|
||||
final fallback = drama.episodes.first;
|
||||
@@ -70,7 +70,7 @@ void main() {
|
||||
expect(logic.displayEpisode(city, city.episodes.first).number, 1);
|
||||
});
|
||||
|
||||
test('an unknown picked number stops overriding the fallback', () {
|
||||
test('should_stop_overriding_fallback_when_picked_number_is_unknown', () {
|
||||
final logic = _logic(FakeWatchHistory());
|
||||
final drama = _drama('signal');
|
||||
final fallback = drama.episodes.first;
|
||||
@@ -82,7 +82,7 @@ void main() {
|
||||
});
|
||||
|
||||
group('nextVisibleIndex', () {
|
||||
test('walks the visible list and stops at the end', () {
|
||||
test('should_walk_visible_list_and_stop_at_the_end_when_advancing', () {
|
||||
final logic = _logic(FakeWatchHistory());
|
||||
logic.visibleIndices = [0, 2, 4];
|
||||
|
||||
@@ -91,7 +91,7 @@ void main() {
|
||||
expect(logic.nextVisibleIndex(4), isNull);
|
||||
});
|
||||
|
||||
test('an index outside the visible list has no successor', () {
|
||||
test('should_have_no_successor_when_index_is_outside_visible_list', () {
|
||||
final logic = _logic(FakeWatchHistory());
|
||||
logic.visibleIndices = [0, 2, 4];
|
||||
|
||||
@@ -100,7 +100,7 @@ void main() {
|
||||
expect(logic.nextVisibleIndex(-1), isNull);
|
||||
});
|
||||
|
||||
test('an empty visible list has no successor', () {
|
||||
test('should_have_no_successor_when_visible_list_is_empty', () {
|
||||
final logic = _logic(FakeWatchHistory());
|
||||
logic.visibleIndices = [];
|
||||
|
||||
@@ -109,7 +109,7 @@ void main() {
|
||||
});
|
||||
|
||||
group('surface flags', () {
|
||||
test('clearing the screen hides the chrome until it is restored', () {
|
||||
test('should_hide_chrome_until_restored_when_screen_is_cleared', () {
|
||||
final logic = _logic(FakeWatchHistory());
|
||||
final immersive = <bool>[];
|
||||
logic.onImmersiveChanged = immersive.add;
|
||||
@@ -135,7 +135,7 @@ void main() {
|
||||
expect(immersive, [true, false]);
|
||||
});
|
||||
|
||||
test('a picture in picture callback outranks the cleared screen flag', () async {
|
||||
test('should_outrank_cleared_screen_flag_when_picture_in_picture_callback_fires', () async {
|
||||
final factory = _RecordingFactory();
|
||||
final drama = _drama('signal');
|
||||
final logic = _logic(FakeWatchHistory());
|
||||
@@ -164,7 +164,7 @@ void main() {
|
||||
await _drain(logic);
|
||||
});
|
||||
|
||||
test('a picture in picture callback is ignored once unmounted', () {
|
||||
test('should_ignore_picture_in_picture_callback_when_unmounted', () {
|
||||
final logic = _logic(FakeWatchHistory());
|
||||
logic.isMounted = () => false;
|
||||
|
||||
@@ -175,7 +175,7 @@ void main() {
|
||||
});
|
||||
|
||||
group('history writes', () {
|
||||
test('progress writes are serialized in call order', () async {
|
||||
test('should_serialize_progress_writes_in_call_order_when_saving', () async {
|
||||
final history = FakeWatchHistory();
|
||||
final logic = _logic(history);
|
||||
final drama = _drama('signal');
|
||||
@@ -197,7 +197,7 @@ void main() {
|
||||
]);
|
||||
});
|
||||
|
||||
test('a failed write does not drop the writes after it', () async {
|
||||
test('should_keep_later_writes_when_an_earlier_write_fails', () async {
|
||||
final history = FakeWatchHistory();
|
||||
final logic = _logic(history);
|
||||
final drama = _drama('signal');
|
||||
@@ -219,7 +219,7 @@ void main() {
|
||||
expect(history.writes, ['demo-local-v1|signal|signal-2|2000']);
|
||||
});
|
||||
|
||||
test('saving with no tracked player writes nothing', () async {
|
||||
test('should_write_nothing_when_no_player_is_tracked', () async {
|
||||
final history = FakeWatchHistory();
|
||||
final logic = _logic(history);
|
||||
|
||||
@@ -232,7 +232,7 @@ void main() {
|
||||
});
|
||||
|
||||
group('start', () {
|
||||
test('a detail route plays a single series', () async {
|
||||
test('should_play_single_series_when_route_is_detail', () async {
|
||||
final factory = _RecordingFactory();
|
||||
final drama = _drama('signal');
|
||||
final logic = _logic(FakeWatchHistory());
|
||||
@@ -255,7 +255,7 @@ void main() {
|
||||
expect(factory.live, 0);
|
||||
});
|
||||
|
||||
test('home mode plays one episode per feed drama', () async {
|
||||
test('should_play_one_episode_per_feed_drama_when_in_home_mode', () async {
|
||||
final factory = _RecordingFactory();
|
||||
final feed = [_drama('signal'), _drama('city'), _drama('vengeance')];
|
||||
final logic = _logic(FakeWatchHistory());
|
||||
@@ -281,7 +281,7 @@ void main() {
|
||||
await _drain(logic);
|
||||
});
|
||||
|
||||
test('a locked episode never reaches the player factory', () async {
|
||||
test('should_never_reach_player_factory_when_episode_is_locked', () async {
|
||||
final factory = _RecordingFactory();
|
||||
final drama = _drama('locked', isFree: false);
|
||||
final logic = _logic(FakeWatchHistory());
|
||||
@@ -300,7 +300,7 @@ void main() {
|
||||
await _drain(logic);
|
||||
});
|
||||
|
||||
test('starting from a later index only preloads what follows it', () async {
|
||||
test('should_preload_only_what_follows_when_starting_from_a_later_index', () async {
|
||||
final factory = _RecordingFactory();
|
||||
final drama = _drama('signal');
|
||||
final logic = _logic(FakeWatchHistory());
|
||||
@@ -320,7 +320,7 @@ void main() {
|
||||
await _drain(logic);
|
||||
});
|
||||
|
||||
test('an inactive route holds no players until it becomes visible', () async {
|
||||
test('should_hold_no_players_when_route_is_inactive', () async {
|
||||
final factory = _RecordingFactory();
|
||||
final drama = _drama('signal');
|
||||
final logic = _logic(FakeWatchHistory());
|
||||
@@ -341,7 +341,7 @@ void main() {
|
||||
});
|
||||
|
||||
group('lifecycle', () {
|
||||
test('backgrounding pauses the active player and resuming plays it', () async {
|
||||
test('should_pause_active_player_when_backgrounded_and_play_it_when_resumed', () async {
|
||||
final factory = _RecordingFactory();
|
||||
final drama = _drama('signal');
|
||||
final logic = _logic(FakeWatchHistory());
|
||||
@@ -368,7 +368,7 @@ void main() {
|
||||
await _drain(logic);
|
||||
});
|
||||
|
||||
test('an inactive route stops playing without losing the intent', () async {
|
||||
test('should_stop_playing_without_losing_intent_when_route_becomes_inactive', () async {
|
||||
final factory = _RecordingFactory();
|
||||
final drama = _drama('signal');
|
||||
final logic = _logic(FakeWatchHistory());
|
||||
@@ -398,7 +398,7 @@ void main() {
|
||||
});
|
||||
|
||||
group('dispose', () {
|
||||
test('is safe to repeat and releases every player', () async {
|
||||
test('should_release_every_player_when_dispose_runs_twice', () async {
|
||||
final factory = _RecordingFactory();
|
||||
final drama = _drama('signal');
|
||||
final logic = _logic(FakeWatchHistory());
|
||||
@@ -417,7 +417,7 @@ void main() {
|
||||
expect(() => logic.dispose(), returnsNormally);
|
||||
});
|
||||
|
||||
test('disables further notifications', () async {
|
||||
test('should_disable_further_notifications_when_disposed', () async {
|
||||
final factory = _RecordingFactory();
|
||||
final drama = _drama('signal');
|
||||
final logic = _logic(FakeWatchHistory());
|
||||
|
||||
Reference in new issue
Block a user