mirror of
https://github.com/signalapp/Signal-Desktop.git
synced 2026-04-29 21:00:58 +01:00
Collapse already-seen sets of timeline items
This commit is contained in:
@@ -210,7 +210,12 @@ describe('<Timeline> utilities', () => {
|
||||
});
|
||||
|
||||
describe('getScrollAnchorBeforeUpdate', () => {
|
||||
const fakeItems = (count: number) => times(count, () => uuid());
|
||||
const fakeItems = (count: number) =>
|
||||
times(count, () => ({
|
||||
type: 'none' as const,
|
||||
id: uuid(),
|
||||
messages: undefined,
|
||||
}));
|
||||
|
||||
const defaultProps = {
|
||||
haveNewest: true,
|
||||
@@ -400,7 +405,13 @@ describe('<Timeline> utilities', () => {
|
||||
describe('when a new message comes in', () => {
|
||||
const oldItems = fakeItems(5);
|
||||
const prevProps = { ...defaultProps, items: oldItems };
|
||||
const props = { ...defaultProps, items: [...oldItems, uuid()] };
|
||||
const props = {
|
||||
...defaultProps,
|
||||
items: [
|
||||
...oldItems,
|
||||
{ type: 'none' as const, id: uuid(), messages: undefined },
|
||||
],
|
||||
};
|
||||
|
||||
it('does nothing if not scrolled to the bottom', () => {
|
||||
const isAtBottom = false;
|
||||
|
||||
Reference in New Issue
Block a user