diff options
Diffstat (limited to '__mocks__')
-rw-r--r-- | __mocks__/@nextcloud/auth.ts | 21 | ||||
-rw-r--r-- | __mocks__/@nextcloud/axios.ts | 29 | ||||
-rw-r--r-- | __mocks__/@nextcloud/capabilities.ts | 22 | ||||
-rw-r--r-- | __mocks__/@nextcloud/dialogs.ts | 35 | ||||
-rw-r--r-- | __mocks__/@nextcloud/initial-state.ts | 21 | ||||
-rw-r--r-- | __mocks__/css.js | 21 | ||||
-rw-r--r-- | __mocks__/svg.js | 21 | ||||
-rw-r--r-- | __mocks__/webdav.ts | 21 |
8 files changed, 51 insertions, 140 deletions
diff --git a/__mocks__/@nextcloud/auth.ts b/__mocks__/@nextcloud/auth.ts index e18a50c7c51..8d341dadad7 100644 --- a/__mocks__/@nextcloud/auth.ts +++ b/__mocks__/@nextcloud/auth.ts @@ -1,23 +1,6 @@ /** - * @copyright Copyright (c) 2023 John Molakvoæ <skjnldsv@protonmail.com> - * - * @author John Molakvoæ <skjnldsv@protonmail.com> - * - * @license AGPL-3.0-or-later - * - * 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/>. - * + * SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors + * SPDX-License-Identifier: AGPL-3.0-or-later */ export const getCurrentUser = function() { return { diff --git a/__mocks__/@nextcloud/axios.ts b/__mocks__/@nextcloud/axios.ts index e9a440f4747..5133574d9ed 100644 --- a/__mocks__/@nextcloud/axios.ts +++ b/__mocks__/@nextcloud/axios.ts @@ -1,25 +1,16 @@ /** - * @copyright Copyright (c) 2023 John Molakvoæ <skjnldsv@protonmail.com> - * - * @author John Molakvoæ <skjnldsv@protonmail.com> - * - * @license AGPL-3.0-or-later - * - * 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/>. - * + * SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors + * SPDX-License-Identifier: AGPL-3.0-or-later */ export default { + interceptors: { + response: { + use: () => {}, + }, + request: { + use: () => {}, + }, + }, get: async () => ({ status: 200, data: {} }), delete: async () => ({ status: 200, data: {} }), post: async () => ({ status: 200, data: {} }), diff --git a/__mocks__/@nextcloud/capabilities.ts b/__mocks__/@nextcloud/capabilities.ts new file mode 100644 index 00000000000..b2b33773403 --- /dev/null +++ b/__mocks__/@nextcloud/capabilities.ts @@ -0,0 +1,22 @@ +/** + * SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors + * SPDX-License-Identifier: AGPL-3.0-or-later + */ +import type { Capabilities } from '../../apps/files/src/types' + +export const getCapabilities = (): Capabilities => { + return { + files: { + bigfilechunking: true, + blacklisted_files: [], + forbidden_filename_basenames: [], + forbidden_filename_characters: [], + forbidden_filename_extensions: [], + forbidden_filenames: [], + undelete: true, + version_deletion: true, + version_labeling: true, + versioning: true, + }, + } +} diff --git a/__mocks__/@nextcloud/dialogs.ts b/__mocks__/@nextcloud/dialogs.ts index 4b9f5de87c7..54705735508 100644 --- a/__mocks__/@nextcloud/dialogs.ts +++ b/__mocks__/@nextcloud/dialogs.ts @@ -1,30 +1,13 @@ /** - * @copyright Copyright (c) 2023 John Molakvoæ <skjnldsv@protonmail.com> - * - * @author John Molakvoæ <skjnldsv@protonmail.com> - * - * @license AGPL-3.0-or-later - * - * 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/>. - * + * SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors + * SPDX-License-Identifier: AGPL-3.0-or-later */ -import { jest } from '@jest/globals' +import { vi } from 'vitest' -export const showMessage = jest.fn() -export const showSuccess = jest.fn() -export const showWarning = jest.fn() -export const showInfo = jest.fn() -export const showError = jest.fn() -export const showUndo = jest.fn() +export const showMessage = vi.fn() +export const showSuccess = vi.fn() +export const showWarning = vi.fn() +export const showInfo = vi.fn() +export const showError = vi.fn() +export const showUndo = vi.fn() diff --git a/__mocks__/@nextcloud/initial-state.ts b/__mocks__/@nextcloud/initial-state.ts index d4396311ec8..a562259b93f 100644 --- a/__mocks__/@nextcloud/initial-state.ts +++ b/__mocks__/@nextcloud/initial-state.ts @@ -1,23 +1,6 @@ /** - * @copyright Copyright (c) 2023 John Molakvoæ <skjnldsv@protonmail.com> - * - * @author John Molakvoæ <skjnldsv@protonmail.com> - * - * @license AGPL-3.0-or-later - * - * 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/>. - * + * SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors + * SPDX-License-Identifier: AGPL-3.0-or-later */ export const loadState = function(app: string, key: string, fallback?: any) { diff --git a/__mocks__/css.js b/__mocks__/css.js index f2c71be8c32..152c532f313 100644 --- a/__mocks__/css.js +++ b/__mocks__/css.js @@ -1,22 +1,5 @@ /** - * @copyright Copyright (c) 2023 Lucas Azevedo <lhs_azevedo@hotmail.com> - * - * @author Lucas Azevedo <lhs_azevedo@hotmail.com> - * - * @license AGPL-3.0-or-later - * - * 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/>. - * + * SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors + * SPDX-License-Identifier: AGPL-3.0-or-later */ export default {} diff --git a/__mocks__/svg.js b/__mocks__/svg.js index 1afe4357c0d..70674e5a0d0 100644 --- a/__mocks__/svg.js +++ b/__mocks__/svg.js @@ -1,22 +1,5 @@ /** - * @copyright Copyright (c) 2023 John Molakvoæ <skjnldsv@protonmail.com> - * - * @author John Molakvoæ <skjnldsv@protonmail.com> - * - * @license AGPL-3.0-or-later - * - * 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/>. - * + * SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors + * SPDX-License-Identifier: AGPL-3.0-or-later */ export default '<svg>SvgMock</svg>' diff --git a/__mocks__/webdav.ts b/__mocks__/webdav.ts index 5a1498c0e2d..7f56c7000b0 100644 --- a/__mocks__/webdav.ts +++ b/__mocks__/webdav.ts @@ -1,23 +1,6 @@ /** - * @copyright Copyright (c) 2023 John Molakvoæ <skjnldsv@protonmail.com> - * - * @author John Molakvoæ <skjnldsv@protonmail.com> - * - * @license AGPL-3.0-or-later - * - * 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/>. - * + * SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors + * SPDX-License-Identifier: AGPL-3.0-or-later */ export const createClient = () => {} export const getPatcher = () => { |