Skip to content

Commit

Permalink
Add maps tests
Browse files Browse the repository at this point in the history
  • Loading branch information
manmorjim committed Jun 9, 2020
1 parent 9aff1aa commit 809b6a4
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions src/lib/maps/__tests__/Client.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import { Credentials } from '@carto/toolkit-core';
import { MapOptions, Maps as Client } from '../src/Client';

describe('maps', () => {
it('can be easily created', () => {
const credentials = new Credentials('aUser', 'anApiKey');
const m = new Client(credentials);
expect(m).toBeTruthy();
});

describe('create a simple map', () => {
it('fails without dataset or sql query', async () => {
const credentials = new Credentials('aUser', 'anApiKey');
const m = new Client(credentials);

const mapOptions: MapOptions = {
vectorExtent: 2048,
vectorSimplifyExtent: 2048
};

await expect(m.instantiateMapFrom(mapOptions)).rejects.toThrowError(
'Please provide a dataset or a SQL query'
);
});
});
});

0 comments on commit 809b6a4

Please sign in to comment.