Restore mobile Chats workspace on tab retap
This commit is contained in:
@@ -253,4 +253,33 @@ void main() {
|
||||
// Unknown deeper paths still resolve to the default list.
|
||||
expect(AppRoute.parse('/schedules/1'), AppRoute.pipelines);
|
||||
});
|
||||
|
||||
test('retapping Chats reopens only a retained workspace from its list', () {
|
||||
final workspace = AppRoute.chatSession('active');
|
||||
expect(chatRouteForRetap(AppRoute.chat, workspace), workspace);
|
||||
expect(
|
||||
chatRouteForRetap(
|
||||
AppRoute.chat,
|
||||
workspace,
|
||||
isValidSession: (id) => id == 'active',
|
||||
),
|
||||
workspace,
|
||||
);
|
||||
expect(
|
||||
chatRouteForRetap(
|
||||
AppRoute.chat,
|
||||
workspace,
|
||||
isValidSession: (id) => id == 'other',
|
||||
),
|
||||
isNull,
|
||||
);
|
||||
expect(chatRouteForRetap(AppRoute.chat, null), isNull);
|
||||
expect(chatRouteForRetap(AppRoute.chat, AppRoute.chat), isNull);
|
||||
});
|
||||
|
||||
test('retapping Chats while a chat is open does not return to the list', () {
|
||||
final current = AppRoute.chatSession('active');
|
||||
expect(chatRouteForRetap(current, AppRoute.chatSession('older')), current);
|
||||
expect(chatRouteForRetap(AppRoute.pipelines, current), isNull);
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user