added svcapi ui and camunda code
[it/otf.git] / otf-frontend / server / test / hooks / group-filter.test.js
diff --git a/otf-frontend/server/test/hooks/group-filter.test.js b/otf-frontend/server/test/hooks/group-filter.test.js
new file mode 100644 (file)
index 0000000..71d02c6
--- /dev/null
@@ -0,0 +1,25 @@
+const assert = require('assert');\r
+const feathers = require('@feathersjs/feathers');\r
+const groupFilter = require('../../src/hooks/group-filter');\r
+\r
+describe('\'groupFilter\' hook', () => {\r
+       let app;\r
+\r
+       beforeEach(() => {\r
+               app = feathers();\r
+\r
+               app.use('/dummy', {\r
+                       async get (id) {\r
+                               return { id };\r
+                       }\r
+               });\r
+\r
+               app.service('dummy').hooks({});\r
+       });\r
+\r
+       it('runs the hook', async () => {\r
+               const result = await app.service('dummy').get('test');\r
+\r
+               assert.deepEqual(result, { id: 'test' });\r
+       });\r
+});\r