mirror of
https://github.com/signalapp/Signal-Desktop.git
synced 2026-04-24 18:38:15 +01:00
Fix timestamps/spellcheck to use locale override
This commit is contained in:
@@ -12,6 +12,7 @@ const max = new Date(2023, 0, 1, 23).getTime();
|
||||
describe('formatTimestamp', () => {
|
||||
let sandbox: sinon.SinonSandbox;
|
||||
let localesStub: sinon.SinonStub;
|
||||
let localeOverrideStub: sinon.SinonStub;
|
||||
let hourCycleStub: sinon.SinonStub;
|
||||
|
||||
beforeEach(() => {
|
||||
@@ -20,6 +21,10 @@ describe('formatTimestamp', () => {
|
||||
window.SignalContext,
|
||||
'getPreferredSystemLocales'
|
||||
);
|
||||
localeOverrideStub = sandbox.stub(
|
||||
window.SignalContext,
|
||||
'getLocaleOverride'
|
||||
);
|
||||
hourCycleStub = sandbox.stub(
|
||||
window.SignalContext,
|
||||
'getHourCyclePreference'
|
||||
@@ -41,6 +46,7 @@ describe('formatTimestamp', () => {
|
||||
}).format(time);
|
||||
it(`should format with locale: ${locale} (${HourCyclePreference[preference]}) @ ${timeFmt})`, () => {
|
||||
localesStub.returns([locale]);
|
||||
localeOverrideStub.returns(null);
|
||||
hourCycleStub.returns(preference);
|
||||
assert.equal(formatTimestamp(time, { timeStyle: 'medium' }), expected);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user