summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorFerdinand Thiessen <opensource@fthiessen.de>2025-03-11 13:22:12 +0100
committerFerdinand Thiessen <opensource@fthiessen.de>2025-03-13 21:30:43 +0100
commitf9355decbc2957abf591de8cfe2503dae95ae291 (patch)
tree3416ff97808b4513430a6429f7dad3be27a0a093 /apps
parentb15ce12f2819e7cb14360e1b48c19886466fab0c (diff)
downloadnextcloud-server-f9355decbc2957abf591de8cfe2503dae95ae291.tar.gz
nextcloud-server-f9355decbc2957abf591de8cfe2503dae95ae291.zip
test(files_trashbin): add test coverage also for utils like the logger
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
Diffstat (limited to 'apps')
-rw-r--r--apps/files_trashbin/src/logger.spec.ts20
1 files changed, 20 insertions, 0 deletions
diff --git a/apps/files_trashbin/src/logger.spec.ts b/apps/files_trashbin/src/logger.spec.ts
new file mode 100644
index 00000000000..5558419ba9d
--- /dev/null
+++ b/apps/files_trashbin/src/logger.spec.ts
@@ -0,0 +1,20 @@
+/**
+ * SPDX-FileCopyrightText: 2025 Nextcloud GmbH and Nextcloud contributors
+ * SPDX-License-Identifier: AGPL-3.0-or-later
+ */
+
+import { describe, expect, it, vi } from 'vitest'
+import { logger } from './logger.ts'
+
+describe('files_trashbin: logger', () => {
+ // Rest of the logger is not under our responsibility but nextcloud-logger
+ it('has correct app name set up', () => {
+ const consoleSpy = vi.spyOn(globalThis.console, 'error').mockImplementationOnce(() => {})
+
+ logger.error('<message>')
+ expect(consoleSpy).toBeCalledTimes(1)
+ expect(consoleSpy.mock.calls[0][0]).toContain('<message>')
+ expect(consoleSpy.mock.calls[0][0]).toContain('files_trashbin')
+ expect(consoleSpy.mock.calls[0][1].app).toBe('files_trashbin')
+ })
+})