Loading src/defaults/defaultCategories.js +16 −16 Original line number Diff line number Diff line Loading @@ -19,25 +19,25 @@ * License along with this library. If not, see <http://www.gnu.org/licenses/>. * */ import { translate } from '@nextcloud/l10n' import { translate as t } from '@nextcloud/l10n' export default () => { // This list was taken from https://tools.ietf.org/html/rfc5545#section-5 return [ translate('calendar', 'Anniversary'), translate('calendar', 'Appointment'), translate('calendar', 'Business'), translate('calendar', 'Education'), translate('calendar', 'Holiday'), translate('calendar', 'Meeting'), translate('calendar', 'Miscellaneous'), translate('calendar', 'Non-working hours'), translate('calendar', 'Not in office'), translate('calendar', 'Personal'), translate('calendar', 'Phone call'), translate('calendar', 'Sick day'), translate('calendar', 'Special occasion'), translate('calendar', 'Travel'), translate('calendar', 'Vacation'), t('calendar', 'Anniversary'), t('calendar', 'Appointment'), t('calendar', 'Business'), t('calendar', 'Education'), t('calendar', 'Holiday'), t('calendar', 'Meeting'), t('calendar', 'Miscellaneous'), t('calendar', 'Non-working hours'), t('calendar', 'Not in office'), t('calendar', 'Personal'), t('calendar', 'Phone call'), t('calendar', 'Sick day'), t('calendar', 'Special occasion'), t('calendar', 'Travel'), t('calendar', 'Vacation'), ] } tests/javascript/unit/defaults/defaultAlarmProvider.test.js 0 → 100644 +49 −0 Original line number Diff line number Diff line /** * @copyright Copyright (c) 2019 Georg Ehrke * * @author Georg Ehrke <oc.list@georgehrke.com> * * @license GNU AGPL version 3 or any later version * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of the * License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. * */ import getDefaultAlarms from '../../../../src/defaults/defaultAlarmProvider.js' describe('defaults/defaultAlarmProvider test suite', () => { it('should provide default alarms for timed events', () => { expect(getDefaultAlarms()).toEqual([ 0, -300, -600, -900, -1800, -3600, -7200, -86400, -172800, ]) }) it('should provide default alarms for all-day events', () => { expect(getDefaultAlarms(true)).toEqual([ 32400, -54000, -140400, -572400, ]) }) }) tests/javascript/unit/defaults/defaultCategories.test.js 0 → 100644 +46 −0 Original line number Diff line number Diff line /** * @copyright Copyright (c) 2019 Georg Ehrke * * @author Georg Ehrke <oc.list@georgehrke.com> * * @license GNU AGPL version 3 or any later version * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of the * License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. * */ import defaultCategories from '../../../../src/defaults/defaultCategories.js' describe('defaults/defaultCategories test suite', () => { it('should provide a default set of categories', () => { expect(defaultCategories()).toEqual([ 'TRANSLATED:Anniversary', 'TRANSLATED:Appointment', 'TRANSLATED:Business', 'TRANSLATED:Education', 'TRANSLATED:Holiday', 'TRANSLATED:Meeting', 'TRANSLATED:Miscellaneous', 'TRANSLATED:Non-working hours', 'TRANSLATED:Not in office', 'TRANSLATED:Personal', 'TRANSLATED:Phone call', 'TRANSLATED:Sick day', 'TRANSLATED:Special occasion', 'TRANSLATED:Travel', 'TRANSLATED:Vacation', ]) }) }) Loading
src/defaults/defaultCategories.js +16 −16 Original line number Diff line number Diff line Loading @@ -19,25 +19,25 @@ * License along with this library. If not, see <http://www.gnu.org/licenses/>. * */ import { translate } from '@nextcloud/l10n' import { translate as t } from '@nextcloud/l10n' export default () => { // This list was taken from https://tools.ietf.org/html/rfc5545#section-5 return [ translate('calendar', 'Anniversary'), translate('calendar', 'Appointment'), translate('calendar', 'Business'), translate('calendar', 'Education'), translate('calendar', 'Holiday'), translate('calendar', 'Meeting'), translate('calendar', 'Miscellaneous'), translate('calendar', 'Non-working hours'), translate('calendar', 'Not in office'), translate('calendar', 'Personal'), translate('calendar', 'Phone call'), translate('calendar', 'Sick day'), translate('calendar', 'Special occasion'), translate('calendar', 'Travel'), translate('calendar', 'Vacation'), t('calendar', 'Anniversary'), t('calendar', 'Appointment'), t('calendar', 'Business'), t('calendar', 'Education'), t('calendar', 'Holiday'), t('calendar', 'Meeting'), t('calendar', 'Miscellaneous'), t('calendar', 'Non-working hours'), t('calendar', 'Not in office'), t('calendar', 'Personal'), t('calendar', 'Phone call'), t('calendar', 'Sick day'), t('calendar', 'Special occasion'), t('calendar', 'Travel'), t('calendar', 'Vacation'), ] }
tests/javascript/unit/defaults/defaultAlarmProvider.test.js 0 → 100644 +49 −0 Original line number Diff line number Diff line /** * @copyright Copyright (c) 2019 Georg Ehrke * * @author Georg Ehrke <oc.list@georgehrke.com> * * @license GNU AGPL version 3 or any later version * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of the * License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. * */ import getDefaultAlarms from '../../../../src/defaults/defaultAlarmProvider.js' describe('defaults/defaultAlarmProvider test suite', () => { it('should provide default alarms for timed events', () => { expect(getDefaultAlarms()).toEqual([ 0, -300, -600, -900, -1800, -3600, -7200, -86400, -172800, ]) }) it('should provide default alarms for all-day events', () => { expect(getDefaultAlarms(true)).toEqual([ 32400, -54000, -140400, -572400, ]) }) })
tests/javascript/unit/defaults/defaultCategories.test.js 0 → 100644 +46 −0 Original line number Diff line number Diff line /** * @copyright Copyright (c) 2019 Georg Ehrke * * @author Georg Ehrke <oc.list@georgehrke.com> * * @license GNU AGPL version 3 or any later version * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of the * License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. * */ import defaultCategories from '../../../../src/defaults/defaultCategories.js' describe('defaults/defaultCategories test suite', () => { it('should provide a default set of categories', () => { expect(defaultCategories()).toEqual([ 'TRANSLATED:Anniversary', 'TRANSLATED:Appointment', 'TRANSLATED:Business', 'TRANSLATED:Education', 'TRANSLATED:Holiday', 'TRANSLATED:Meeting', 'TRANSLATED:Miscellaneous', 'TRANSLATED:Non-working hours', 'TRANSLATED:Not in office', 'TRANSLATED:Personal', 'TRANSLATED:Phone call', 'TRANSLATED:Sick day', 'TRANSLATED:Special occasion', 'TRANSLATED:Travel', 'TRANSLATED:Vacation', ]) }) })