@defra-fish/gafl-webapp-service
Version:
The websales frontend for the GAFL service
24 lines (20 loc) • 630 B
JavaScript
import { getData } from '../route'
describe('name > route', () => {
const mockTransactionCacheGet = jest.fn()
const mockRequest = {
cache: () => ({
helpers: {
transaction: {
getCurrentPermission: mockTransactionCacheGet
}
}
})
}
describe('getData', () => {
it('should return isLicenceForYou as true, if isLicenceForYou is true on the transaction cache', async () => {
mockTransactionCacheGet.mockImplementationOnce(() => ({ isLicenceForYou: true }))
const result = await getData(mockRequest)
expect(result.isLicenceForYou).toBeTruthy()
})
})
})