a80b78d946
Signed-off-by: Raimund Schlüßler <raimund.schluessler@mailbox.org>
32 lines
846 B
JavaScript
32 lines
846 B
JavaScript
import VueTestUtils from '@vue/test-utils'
|
|
import { OC } from './OC.js'
|
|
import moment from 'moment'
|
|
import MockDate from 'mockdate'
|
|
|
|
// Set date to fixed value
|
|
MockDate.set(moment('20190101T123456', 'YYYYMMDDTHHmmss'))
|
|
|
|
global.OC = new OC()
|
|
global.moment = moment
|
|
|
|
// Mock nextcloud translate functions
|
|
VueTestUtils.config.mocks.$t = function(app, string) {
|
|
return string
|
|
}
|
|
VueTestUtils.config.mocks.t = VueTestUtils.config.mocks.$t
|
|
global.t = VueTestUtils.config.mocks.$t
|
|
|
|
VueTestUtils.config.mocks.$n = function(app, singular, plural, count) {
|
|
return singular
|
|
}
|
|
VueTestUtils.config.mocks.n = VueTestUtils.config.mocks.$n
|
|
global.n = VueTestUtils.config.mocks.$n
|
|
|
|
global.OCA = {}
|
|
global.OCA.Tasks = {}
|
|
global.OCA.Tasks.$t = VueTestUtils.config.mocks.$t
|
|
global.OCA.Tasks.$n = VueTestUtils.config.mocks.$n
|
|
|
|
afterAll(() => {
|
|
MockDate.reset()
|
|
});
|