aboutsummaryrefslogtreecommitdiffstats
path: root/__mocks__
diff options
context:
space:
mode:
authorJohn Molakvoæ <skjnldsv@protonmail.com>2023-06-14 10:50:55 +0200
committerJohn Molakvoæ <skjnldsv@protonmail.com>2023-06-21 09:08:04 +0200
commit9fbdc002741b1b6101fe5eff7d84196bdfb6d5c5 (patch)
treef2d0d3db66b7f575f24729e7240c85edb825ab02 /__mocks__
parentc31b2329dc6fbac8c1400c8be12d090089b6f359 (diff)
downloadnextcloud-server-9fbdc002741b1b6101fe5eff7d84196bdfb6d5c5.tar.gz
nextcloud-server-9fbdc002741b1b6101fe5eff7d84196bdfb6d5c5.zip
feat: add delete action testing
Signed-off-by: John Molakvoæ <skjnldsv@protonmail.com>
Diffstat (limited to '__mocks__')
-rw-r--r--__mocks__/@nextcloud/auth.js15
-rw-r--r--__mocks__/@nextcloud/auth.ts34
-rw-r--r--__mocks__/@nextcloud/axios.ts24
-rw-r--r--__mocks__/svg.js23
4 files changed, 80 insertions, 16 deletions
diff --git a/__mocks__/@nextcloud/auth.js b/__mocks__/@nextcloud/auth.js
deleted file mode 100644
index ba0ae211790..00000000000
--- a/__mocks__/@nextcloud/auth.js
+++ /dev/null
@@ -1,15 +0,0 @@
-import { c } from "tar"
-
-export const getCurrentUser = function() {
- return {
- uid: 'test',
- displayName: 'Test',
- isAdmin: false,
- }
-}
-
-export const getRequestToken = function() {
- return 'test-token-1234'
-}
-
-export const onRequestTokenUpdate = function() {}
diff --git a/__mocks__/@nextcloud/auth.ts b/__mocks__/@nextcloud/auth.ts
new file mode 100644
index 00000000000..e18a50c7c51
--- /dev/null
+++ b/__mocks__/@nextcloud/auth.ts
@@ -0,0 +1,34 @@
+/**
+ * @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/>.
+ *
+ */
+export const getCurrentUser = function() {
+ return {
+ uid: 'test',
+ displayName: 'Test',
+ isAdmin: false,
+ }
+}
+
+export const getRequestToken = function() {
+ return 'test-token-1234'
+}
+
+export const onRequestTokenUpdate = function() {}
diff --git a/__mocks__/@nextcloud/axios.ts b/__mocks__/@nextcloud/axios.ts
new file mode 100644
index 00000000000..c78420c98b0
--- /dev/null
+++ b/__mocks__/@nextcloud/axios.ts
@@ -0,0 +1,24 @@
+/**
+ * @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/>.
+ *
+ */
+export default {
+ delete: async () => ({ status: 200, data: {} }),
+}
diff --git a/__mocks__/svg.js b/__mocks__/svg.js
index 7e40e291e33..52b1041f754 100644
--- a/__mocks__/svg.js
+++ b/__mocks__/svg.js
@@ -1 +1,22 @@
-module.exports = 'SvgMock'
+/**
+ * @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/>.
+ *
+ */
+export default 'SvgMock'