UNPKG

@smart-consulting/lattice-services

Version:

Collection of common types and functions for connecting to Lattice services

21 lines (20 loc) 702 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var axios_1 = require("axios"); var auth_1 = require("./auth"); jest.mock('axios'); var mockedAxios = axios_1.default; describe('getProfile', function () { it('fetches data successfully', function () { var resData = { name: 'John Doe', nickname: 'Johnny', picture: 'picture.png', sub: 'auth0|dummy', team: 'SC', permissions: { adminservice: ['test:read:team'] }, }; mockedAxios.get.mockResolvedValue({ data: resData }); auth_1.getProfile().then(function (data) { return expect(data).toEqual(resData); }); }); });