Merge pull request #135 from BeaudanBrown/timezone-test-fix

Small fix for strange bug…
pull/138/head
sachaaaaa 6 years ago committed by GitHub
commit 90a9c554c5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -45,12 +45,13 @@ describe('Attachment', () => {
data: stringToArrayBuffer('foo'), data: stringToArrayBuffer('foo'),
contentType: MIME.VIDEO_QUICKTIME, contentType: MIME.VIDEO_QUICKTIME,
}; };
const timestamp = new Date(-moment().utcOffset() * 60 * 1000); // Unix timestamp of start of year 2000 to fix odd sudo timezone bug
const timestamp = new Date(946684800000 - moment().utcOffset() * 60 * 1000);
const actual = Attachment.getSuggestedFilename({ const actual = Attachment.getSuggestedFilename({
attachment, attachment,
timestamp, timestamp,
}); });
const expected = 'signal-attachment-1970-01-01-000000.mov'; const expected = 'signal-attachment-2000-01-01-000000.mov';
assert.strictEqual(actual, expected); assert.strictEqual(actual, expected);
}); });
}); });

Loading…
Cancel
Save