test: fix most e2e tests
This commit is contained in:
@@ -79,4 +79,38 @@ describe('user avatar sync helpers', () => {
|
||||
updatedAt: 100
|
||||
})).toBe(false);
|
||||
});
|
||||
|
||||
it('requests data when only the remote profile text is newer and no avatar exists', () => {
|
||||
const existingUser = createUser({
|
||||
displayName: 'Alice',
|
||||
profileUpdatedAt: 100
|
||||
});
|
||||
|
||||
expect(shouldRequestAvatarData(existingUser, {
|
||||
avatarUpdatedAt: 0,
|
||||
profileUpdatedAt: 200
|
||||
})).toBe(true);
|
||||
});
|
||||
|
||||
it('does not request profile data when the local profile is the same or newer', () => {
|
||||
const existingUser = createUser({ profileUpdatedAt: 200 });
|
||||
|
||||
expect(shouldRequestAvatarData(existingUser, {
|
||||
avatarUpdatedAt: 0,
|
||||
profileUpdatedAt: 200
|
||||
})).toBe(false);
|
||||
});
|
||||
|
||||
it('applies profile-only transfers when the remote profile is newer', () => {
|
||||
const existingUser = createUser({
|
||||
displayName: 'Alice',
|
||||
profileUpdatedAt: 100
|
||||
});
|
||||
|
||||
expect(shouldApplyAvatarTransfer(existingUser, {
|
||||
hash: undefined,
|
||||
updatedAt: 0,
|
||||
profileUpdatedAt: 200
|
||||
})).toBe(true);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user