discourse/test/javascripts/helpers
Martin Brennan 7e303f9320
DEV: Upgrade sinon and fix time based bookmark tests (#9647)
Update sinon.js to 9.0.2 to access async fake timers https://sinonjs.org/releases/v9.0.2/fake-timers/ which can then be used with acceptance tests (previously useFakeTimers didn't work with await, e.g. for visit).

Fix the bookmark acceptance test that was time based to use these new fake timers.

Add a fakeTime function that uses moment and the provided date string + timezone to freeze time using useFakeTimers and return a clock.

Add a timeStep function that accepts a clock from fakeTime and a function to run. Once the function is run we call clock.tickAsync(1000) to progress the fake clock forward 1s to progress promises/callbacks.
2020-05-07 09:10:32 +10:00
..
assertions.js FIX: Flaky tests. Due to CSS transitions opacity might not be 0 yet. 2020-05-05 13:45:14 -04:00
component-test.js Retry: Rename all test files from JS -> ES6 2020-03-26 12:25:46 -04:00
create-pretender.js Retry: Rename all test files from JS -> ES6 2020-03-26 12:25:46 -04:00
create-store.js FIX: allows adapters to define a custom primaryKey (#9254) 2020-03-30 15:23:59 +02:00
d-editor-helper.js Retry: Rename all test files from JS -> ES6 2020-03-26 12:25:46 -04:00
fixture-pretender.js Retry: Rename all test files from JS -> ES6 2020-03-26 12:25:46 -04:00
html-helper.js Retry: Rename all test files from JS -> ES6 2020-03-26 12:25:46 -04:00
qunit-helpers.js DEV: Upgrade sinon and fix time based bookmark tests (#9647) 2020-05-07 09:10:32 +10:00
review-pretender.js Retry: Rename all test files from JS -> ES6 2020-03-26 12:25:46 -04:00
select-kit-helper.js DEV: improves sk api (#9653) 2020-05-06 17:16:20 +02:00
site-settings.js FIX: Rename all instances of bookmarkWithReminder to just bookmark (#9579) 2020-04-30 10:09:22 +10:00
site.js DEV: Move preload-store to discourse/lib/preload-store 2020-05-06 15:28:06 -04:00
store-pretender.js FIX: allows adapters to define a custom primaryKey (#9254) 2020-03-30 15:23:59 +02:00
textarea-selection-helper.js Retry: Rename all test files from JS -> ES6 2020-03-26 12:25:46 -04:00
widget-test.js DEV: Allows moduleForWidget to use before/afterEach options (#9296) 2020-03-30 18:12:32 +02:00