Skip to content

Commit

Permalink
Fixes E2E tests
Browse files Browse the repository at this point in the history
  • Loading branch information
michael-s-molina committed Jun 8, 2023
1 parent 1e1b5f9 commit 4a966fc
Show file tree
Hide file tree
Showing 17 changed files with 1,194 additions and 1,186 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ describe('Dashboard edit', () => {
'[data-test-chart-name="Top 10 California Names Timeseries"] .line .nv-legend-symbol',
)
.first()
.should('have.css', 'fill', 'rgb(51, 217, 193)');
.should('have.css', 'fill', 'rgb(51, 61, 71)');

// open 2nd main tab
openTab(0, 1);
Expand All @@ -239,7 +239,7 @@ describe('Dashboard edit', () => {
// label Anthony
cy.get('[data-test-chart-name="Trends"] .line .nv-legend-symbol')
.eq(2)
.should('have.css', 'fill', 'rgb(51, 217, 193)');
.should('have.css', 'fill', 'rgb(51, 61, 71)');
});

it('should apply same color to same labels with no color scheme set', () => {
Expand Down Expand Up @@ -393,7 +393,7 @@ describe('Dashboard edit', () => {
'[data-test-chart-name="Top 10 California Names Timeseries"] .line .nv-legend-symbol',
)
.eq(2)
.should('have.css', 'fill', 'rgb(168, 104, 183)');
.should('have.css', 'fill', 'rgb(163, 143, 121)');

openProperties();
cy.get('[aria-label="Select color scheme"]').should('have.value', '');
Expand Down Expand Up @@ -422,17 +422,17 @@ describe('Dashboard edit', () => {
'[data-test-chart-name="Top 10 California Names Timeseries"] .line .nv-legend-symbol',
)
.first()
.should('have.css', 'fill', 'rgb(69, 78, 124)');
.should('have.css', 'fill', 'rgb(252, 199, 0)');
cy.get(
'[data-test-chart-name="Top 10 California Names Timeseries"] .line .nv-legend-symbol',
)
.eq(1)
.should('have.css', 'fill', 'rgb(224, 67, 85)');
.should('have.css', 'fill', 'rgb(143, 211, 228)');
cy.get(
'[data-test-chart-name="Top 10 California Names Timeseries"] .line .nv-legend-symbol',
)
.eq(2)
.should('have.css', 'fill', 'rgb(168, 104, 183)');
.should('have.css', 'fill', 'rgb(172, 225, 196)');
});

it('should show the same colors in Explore', () => {
Expand Down Expand Up @@ -463,7 +463,7 @@ describe('Dashboard edit', () => {
'[data-test-chart-name="Top 10 California Names Timeseries"] .line .nv-legend-symbol',
)
.eq(1)
.should('have.css', 'fill', 'rgb(157, 172, 185)');
.should('have.css', 'fill', 'rgb(51, 61, 71)');

openExplore('Top 10 California Names Timeseries');

Expand Down Expand Up @@ -495,7 +495,7 @@ describe('Dashboard edit', () => {
'[data-test-chart-name="Top 10 California Names Timeseries"] .line .nv-legend-symbol',
)
.first()
.should('have.css', 'fill', 'rgb(51, 217, 193)');
.should('have.css', 'fill', 'rgb(51, 61, 71)');

// open 2nd main tab
openTab(0, 1);
Expand All @@ -504,7 +504,7 @@ describe('Dashboard edit', () => {
// label Anthony
cy.get('[data-test-chart-name="Trends"] .line .nv-legend-symbol')
.eq(2)
.should('have.css', 'fill', 'rgb(51, 217, 193)');
.should('have.css', 'fill', 'rgb(51, 61, 71)');

editDashboard();
openProperties();
Expand Down Expand Up @@ -541,7 +541,7 @@ describe('Dashboard edit', () => {

cy.get('[data-test-chart-name="Trends"] .line .nv-legend-symbol')
.first()
.should('have.css', 'fill', 'rgb(234, 11, 140)');
.should('have.css', 'fill', 'rgb(51, 61, 71)');
});

it('should apply the color scheme across main tabs for rendered charts', () => {
Expand All @@ -557,7 +557,7 @@ describe('Dashboard edit', () => {

cy.get('[data-test-chart-name="Trends"] .line .nv-legend-symbol')
.first()
.should('have.css', 'fill', 'rgb(140, 224, 113)');
.should('have.css', 'fill', 'rgb(204, 0, 134)');

// change scheme now that charts are rendered across the main tabs
editDashboard();
Expand Down Expand Up @@ -587,7 +587,7 @@ describe('Dashboard edit', () => {
'[data-test-chart-name="Top 10 California Names Timeseries"] .line .nv-legend-symbol',
)
.first()
.should('have.css', 'fill', 'rgb(51, 217, 193)');
.should('have.css', 'fill', 'rgb(51, 61, 71)');

// open another nested tab
openTab(2, 1);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
* under the License.
*/
import React, { useCallback, useEffect, useMemo, useState } from 'react';
import { omit } from 'lodash';
import { Input } from 'src/components/Input';
import { FormItem } from 'src/components/Form';
import jsonStringify from 'json-stringify-pretty-compact';
Expand Down Expand Up @@ -194,15 +195,11 @@ const PropertiesModal = ({
setRoles(roles);
setColorScheme(metadata.color_scheme);

// temporary fix to remove positions from dashboards' metadata
if (metadata?.positions) {
delete metadata.positions;
}
const metaDataCopy = { ...metadata };

delete metaDataCopy.shared_label_colors;

delete metaDataCopy.color_scheme_domain;
const metaDataCopy = omit(metadata, [
'positions',
'shared_label_colors',
'color_scheme_domain',
]);

setJsonMetadata(metaDataCopy ? jsonStringify(metaDataCopy) : '');
},
Expand Down
Loading

0 comments on commit 4a966fc

Please sign in to comment.