Skip to content

Commit

Permalink
Update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
kravets-levko committed Jul 2, 2019
1 parent 7c78ada commit 17aacc1
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 5 deletions.
2 changes: 1 addition & 1 deletion client/app/visualizations/word-cloud/Renderer.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ function createLayout() {
// TODO: dimensions probably should be larger, but `d3-cloud` has some performance issues related to these values
.size([5000, 5000])
.padding(3)
.font('Impact')
.font('"Roboto Regular", sans-serif')
.rotate(d => d.angle)
.fontSize(d => d.size)
.random(() => 0.5); // do not place words randomly - use compact layout
Expand Down
9 changes: 9 additions & 0 deletions client/app/visualizations/word-cloud/renderer.less
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
@font-face {
font-family: "Roboto Regular";
src: url("../../assets/fonts/roboto/Roboto-Regular-webfont.eot");
src: url("../../assets/fonts/roboto/Roboto-Regular-webfont.eot?#iefix") format("embedded-opentype"),
url("../../assets/fonts/roboto/Roboto-Regular-webfont.woff") format("woff"),
url("../../assets/fonts/roboto/Roboto-Regular-webfont.ttf") format("truetype"),
url("../../assets/fonts/roboto/Roboto-Regular-webfont.svg") format("svg");
}

.word-cloud-visualization-container {
overflow: hidden;
height: 400px;
Expand Down
8 changes: 4 additions & 4 deletions client/cypress/integration/visualizations/word_cloud_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@ describe('Word Cloud', () => {
`);

// Wait for proper initialization of visualization
cy.wait(1000); // eslint-disable-line cypress/no-unnecessary-waiting
cy.wait(500); // eslint-disable-line cypress/no-unnecessary-waiting

cy.getByTestId('VisualizationPreview').find('svg text').should('have.length', 11);

cy.percySnapshot('Visualizations - Word Cloud (Automatic word frequencies)', { widths: [1280] });
cy.percySnapshot('Visualizations - Word Cloud (Automatic word frequencies)');
});

it('creates visualization with word frequencies from another column', () => {
Expand All @@ -51,7 +51,7 @@ describe('Word Cloud', () => {
`);

// Wait for proper initialization of visualization
cy.wait(1000); // eslint-disable-line cypress/no-unnecessary-waiting
cy.wait(500); // eslint-disable-line cypress/no-unnecessary-waiting

cy.getByTestId('VisualizationPreview').find('svg text').should('have.length', 5);

Expand Down Expand Up @@ -79,7 +79,7 @@ describe('Word Cloud', () => {
});

// Wait for proper initialization of visualization
cy.wait(1000); // eslint-disable-line cypress/no-unnecessary-waiting
cy.wait(500); // eslint-disable-line cypress/no-unnecessary-waiting

cy.getByTestId('VisualizationPreview').find('svg text').should('have.length', 2);

Expand Down

0 comments on commit 17aacc1

Please sign in to comment.