@thoughtspot/visual-embed-sdk
Version:
ThoughtSpot Embed SDK
21 lines • 781 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
require("jest-fetch-mock");
const sourceService_1 = require("./sourceService");
describe('Source service tests', () => {
test('Should return source detail and cache it', async () => {
fetchMock.mockResponseOnce(JSON.stringify({
data: {
getSourceDetail: [{
Bla: {
id: {},
},
}],
},
}));
await (0, sourceService_1.getSourceDetail)('https://tshost', 'id');
await (0, sourceService_1.getSourceDetail)('https://tshost', 'id');
expect(fetchMock).toHaveBeenCalledTimes(1);
});
});
//# sourceMappingURL=sourceService.spec.js.map