Skip to content

Commit

Permalink
Update runtime tests
Browse files Browse the repository at this point in the history
  • Loading branch information
arvind committed Jun 16, 2022
1 parent 444301c commit 50ab21f
Show file tree
Hide file tree
Showing 12 changed files with 433 additions and 291 deletions.
24 changes: 23 additions & 1 deletion test-runtime/interval.test.ts
@@ -1,6 +1,6 @@
import {TopLevelSpec} from '../src';
import {SelectionType} from '../src/selection';
import {brush, embedFn, hits as hitsMaster, spec, testRenderFn, tuples} from './util';
import {brush, embedFn, geoSpec, hits as hitsMaster, spec, testRenderFn, tuples} from './util';
import {Page} from 'puppeteer/lib/cjs/puppeteer/common/Page';

describe('interval selections at runtime in unit views', () => {
Expand Down Expand Up @@ -197,4 +197,26 @@ describe('interval selections at runtime in unit views', () => {
await testRender(`logpow_${i}`);
}
});

describe('geo-intervals', () => {
it('should add IDs to the store', async () => {
await embed(geoSpec());
const store = await page.evaluate(brush('drag', 1));
expect(store).toHaveLength(13);
for (const t of store) {
expect(t).toHaveProperty('_vgsid_');
}
await testRender(`geo_1`);
});

it('should respect projections', async () => {
await embed(geoSpec({encodings: ['longitude']}));
const store = await page.evaluate(brush('drag', 0));
expect(store).toHaveLength(20);
for (const t of store) {
expect(t).toHaveProperty('_vgsid_');
}
await testRender(`geo_0`);
});
});
});
1 change: 1 addition & 0 deletions test-runtime/resources/interval/translate/geo-0.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions test-runtime/resources/interval/translate/geo-1.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 50ab21f

Please sign in to comment.