Skip to content

Commit

Permalink
Fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
BenSurgisonGDS committed Aug 29, 2023
1 parent 1d5968b commit 46af372
Showing 1 changed file with 5 additions and 16 deletions.
21 changes: 5 additions & 16 deletions lib/manage-prototype-handlers.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -467,25 +467,14 @@ describe('manage-prototype-handlers', () => {
})
})

describe('postPluginsHandler', () => {
it('postPluginsHandler', async () => {
const search = 'task list'
const routePath = '/plugins-installed'
const fullPath = '/manage-prototype' + routePath
beforeEach(() => {
req.body.search = search
req.route.path = routePath
})

it('search', async () => {
await postPluginsHandler(req, res)
expect(res.redirect).toHaveBeenCalledWith(fullPath + '?search=' + search)
})

it('clear search', async () => {
req.query.clear = 'true'
await postPluginsHandler(req, res)
expect(res.redirect).toHaveBeenCalledWith(fullPath)
})
req.body.search = search
req.route.path = routePath
await postPluginsHandler(req, res)
expect(res.redirect).toHaveBeenCalledWith(fullPath + '?search=' + search)
})

it('getPluginsModeHandler', async () => {
Expand Down

0 comments on commit 46af372

Please sign in to comment.