mirror of
https://github.com/oceanprotocol/market.git
synced 2024-11-15 09:44:53 +01:00
24 lines
564 B
TypeScript
24 lines
564 B
TypeScript
import axios, { AxiosResponse } from 'axios'
|
|
import getAssetRating, {
|
|
GetRatingResponse
|
|
} from '../../../src/utils/getAssetRating'
|
|
|
|
jest.mock('axios')
|
|
|
|
describe('getAssetRating()', () => {
|
|
it('success', async () => {
|
|
const ratingResponse: GetRatingResponse = {
|
|
comment: '',
|
|
datePublished: '',
|
|
vote: 5
|
|
}
|
|
|
|
;(axios.get as any).mockResolvedValueOnce({
|
|
data: [ratingResponse, ratingResponse]
|
|
} as AxiosResponse)
|
|
|
|
const response = await getAssetRating('0x00', '0x00')
|
|
expect(response && response.vote).toBe(5)
|
|
})
|
|
})
|