Skip to content

Commit

Permalink
test: remove d3.format
Browse files Browse the repository at this point in the history
  • Loading branch information
VictorVelarde committed Jul 7, 2020
1 parent 5a34506 commit e3fdbc6
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions src/lib/viz/__tests__/interactivity-popups.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,7 @@ describe('interaction popup', () => {
},
{
attr: 'pop',
title: 'Population D3',
format: '~s' // D3 format see https://github.com/d3/d3-format
title: 'Population D3'
},
{
attr: 'pop',
Expand All @@ -69,13 +68,13 @@ describe('interaction popup', () => {
expect(setContentMockClick).toHaveBeenCalledWith(`<p class="as-body">pop</p>
<p class="as-subheader as-font--medium">10435000</p>`);
});
it('should show a popup when a feature is clicked with a custom title, D3 format and custom format function', async () => {
it('should show a popup when a feature is clicked with a custom title, no format and custom format function', async () => {
await layer.setPopupClick(CUSTOM_PARAM);

layer.emit(InteractivityEventType.CLICK, [[FEATURE], FAKE_COORDS]);
expect(setContentMockClick).toHaveBeenCalledWith(`<p class="as-body"></p>
<p class="as-subheader as-font--medium">15</p><p class="as-body">Population D3</p>
<p class="as-subheader as-font--medium">10.435M</p><p class="as-body">Population Custom</p>
<p class="as-subheader as-font--medium">10435000</p><p class="as-body">Population Custom</p>
<p class="as-subheader as-font--medium">10435K habitants</p>`);
});
it('should do nothing if no parameter is provided', async () => {
Expand All @@ -99,7 +98,7 @@ describe('interaction popup', () => {

expect(setContentMockClick).toHaveBeenCalledWith(`<p class="as-body"></p>
<p class="as-subheader as-font--medium">15</p><p class="as-body">Population D3</p>
<p class="as-subheader as-font--medium">10.435M</p><p class="as-body">Population Custom</p>
<p class="as-subheader as-font--medium">10435000</p><p class="as-body">Population Custom</p>
<p class="as-subheader as-font--medium">10435K habitants</p>`);
expect(setContentMockClick).toHaveBeenCalledTimes(1);
});
Expand All @@ -112,7 +111,7 @@ describe('interaction popup', () => {

expect(setContentMockClick).toHaveBeenCalledWith(`<p class="as-body"></p>
<p class="as-subheader as-font--medium">15</p><p class="as-body">Population D3</p>
<p class="as-subheader as-font--medium">10.435M</p><p class="as-body">Population Custom</p>
<p class="as-subheader as-font--medium">10435000</p><p class="as-body">Population Custom</p>
<p class="as-subheader as-font--medium">10435K habitants</p>`);
expect(setContentMockClick).toHaveBeenCalledTimes(1);
});
Expand All @@ -131,7 +130,7 @@ describe('interaction popup', () => {
layer.emit(InteractivityEventType.HOVER, [[FEATURE], FAKE_COORDS]);
expect(setContentMockHover).toHaveBeenCalledWith(`<p class="as-body"></p>
<p class="as-subheader as-font--medium">15</p><p class="as-body">Population D3</p>
<p class="as-subheader as-font--medium">10.435M</p><p class="as-body">Population Custom</p>
<p class="as-subheader as-font--medium">10435000</p><p class="as-body">Population Custom</p>
<p class="as-subheader as-font--medium">10435K habitants</p>`);
});
it('should do nothing if no parameter is provided', async () => {
Expand All @@ -155,7 +154,7 @@ describe('interaction popup', () => {

expect(setContentMockHover).toHaveBeenCalledWith(`<p class="as-body"></p>
<p class="as-subheader as-font--medium">15</p><p class="as-body">Population D3</p>
<p class="as-subheader as-font--medium">10.435M</p><p class="as-body">Population Custom</p>
<p class="as-subheader as-font--medium">10435000</p><p class="as-body">Population Custom</p>
<p class="as-subheader as-font--medium">10435K habitants</p>`);
expect(setContentMockHover).toHaveBeenCalledTimes(1);
});
Expand All @@ -168,7 +167,7 @@ describe('interaction popup', () => {

expect(setContentMockHover).toHaveBeenCalledWith(`<p class="as-body"></p>
<p class="as-subheader as-font--medium">15</p><p class="as-body">Population D3</p>
<p class="as-subheader as-font--medium">10.435M</p><p class="as-body">Population Custom</p>
<p class="as-subheader as-font--medium">10435000</p><p class="as-body">Population Custom</p>
<p class="as-subheader as-font--medium">10435K habitants</p>`);
expect(setContentMockHover).toHaveBeenCalledTimes(1);
});
Expand Down

0 comments on commit e3fdbc6

Please sign in to comment.