feat(app): chat sections are clear collapsible dividers; closed chats start collapsed
This commit is contained in:
@@ -71,10 +71,7 @@ void main() {
|
||||
|
||||
group('arrival count', () {
|
||||
test('counts only messages after the release point', () {
|
||||
expect(
|
||||
chatNewMessageCount(['m1', 'm2', 'm3'], 'm2'),
|
||||
1,
|
||||
);
|
||||
expect(chatNewMessageCount(['m1', 'm2', 'm3'], 'm2'), 1);
|
||||
expect(
|
||||
chatNewMessageCount(['older', 'm1', 'm2', 'live', 'newer'], 'm2'),
|
||||
2,
|
||||
@@ -98,22 +95,13 @@ void main() {
|
||||
|
||||
group('restore', () {
|
||||
test('no saved position lands on the newest end', () {
|
||||
expect(
|
||||
chatRestoreOffset(savedOffset: null, maxScrollExtent: 640),
|
||||
640,
|
||||
);
|
||||
expect(chatRestoreOffset(savedOffset: null, maxScrollExtent: 640), 640);
|
||||
});
|
||||
|
||||
test('a saved position is kept within the current extent', () {
|
||||
expect(
|
||||
chatRestoreOffset(savedOffset: 120, maxScrollExtent: 640),
|
||||
120,
|
||||
);
|
||||
expect(chatRestoreOffset(savedOffset: 120, maxScrollExtent: 640), 120);
|
||||
expect(chatRestoreOffset(savedOffset: 0, maxScrollExtent: 640), 0);
|
||||
expect(
|
||||
chatRestoreOffset(savedOffset: 900, maxScrollExtent: 640),
|
||||
640,
|
||||
);
|
||||
expect(chatRestoreOffset(savedOffset: 900, maxScrollExtent: 640), 640);
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user