X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=otf-frontend%2Fserver%2Ftest%2Fhooks%2Fgroup-filter.test.js;fp=otf-frontend%2Fserver%2Ftest%2Fhooks%2Fgroup-filter.test.js;h=71d02c6f5fc821c9239edc5c8b2655006f268879;hb=14f6f95c84a4a1fa8774190db4a03fd0214ec55f;hp=0000000000000000000000000000000000000000;hpb=f49bd1efeaaddd4891c1f329b18d8cfb28b3e75b;p=it%2Fotf.git 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 index 0000000..71d02c6 --- /dev/null +++ b/otf-frontend/server/test/hooks/group-filter.test.js @@ -0,0 +1,25 @@ +const assert = require('assert'); +const feathers = require('@feathersjs/feathers'); +const groupFilter = require('../../src/hooks/group-filter'); + +describe('\'groupFilter\' hook', () => { + let app; + + beforeEach(() => { + app = feathers(); + + app.use('/dummy', { + async get (id) { + return { id }; + } + }); + + app.service('dummy').hooks({}); + }); + + it('runs the hook', async () => { + const result = await app.service('dummy').get('test'); + + assert.deepEqual(result, { id: 'test' }); + }); +});