Skip to content

Commit

Permalink
chore: code review tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
emcelroy committed Jul 3, 2024
1 parent 5b0d82d commit 2f98e82
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions cypress/e2e/functional/document_tests/tiles_copy_test_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import DataCardToolTile from '../../../support/elements/tile/DataCardToolTile';
import DataflowToolTile from '../../../support/elements/tile/DataflowToolTile';
import SimulatorTile from '../../../support/elements/tile/SimulatorTile';
import DiagramToolTile from '../../../support/elements/tile/DiagramToolTile';
import XYPlotToolTile from "../../../support/elements/tile/XYPlotToolTile";

const student5 = `${Cypress.config("qaUnitStudent5")}`;
const student6 = `${Cypress.config("qaUnitStudent6")}`;
Expand All @@ -24,7 +25,8 @@ let clueCanvas = new ClueCanvas,
dc = new DataCardToolTile,
dataflowToolTile = new DataflowToolTile,
simulatorTile = new SimulatorTile,
diagramTile = new DiagramToolTile;
diagramTile = new DiagramToolTile,
graphTile = new XYPlotToolTile;
let canvas = new Canvas;

const imageName = "Image Tile";
Expand Down Expand Up @@ -330,21 +332,21 @@ context("Test copy tile within a document", function () {
cy.get("[data-original-title='Graph It!']").click();
cy.get("[data-test=link-tile-select]").select("New Graph");
cy.get(".modal-button").contains("Graph It").click();
cy.get(".primary-workspace .graph-wrapper").should("have.length", 1);
cy.get(".primary-workspace .graph-wrapper .editable-tile-title-text").first().should("contain", "Graph 1");
cy.get(".primary-workspace .graph-wrapper .editable-tile-title-text").first().click();
graphTile.getTile().should("have.length", 1);
graphTile.getXYPlotTitle().first().should("contain", "Graph 1");
graphTile.getXYPlotTitle().first().click();
cy.get(".primary-workspace .graph-wrapper .editable-tile-title").first().type(categoricalGraphName + "{enter}");
cy.get(".primary-workspace .graph-wrapper .editable-tile-title-text").first().should("contain", categoricalGraphName);
cy.get(".primary-workspace .graph-wrapper").first().find("g.graph-dot").should("have.length", 2).each(($g) => {
graphTile.getXYPlotTitle().first().should("contain", categoricalGraphName);
graphTile.getGraphDot().should("have.length", 2).each(($g) => {
cy.wrap($g).should("have.attr", "transform").should("not.be.empty");
});

// Click on new graph tile to select it, then copy it
cy.get(".primary-workspace .graph-wrapper").first().click();
graphTile.getTile().first().click();
cy.get("[data-testid=tool-duplicate]").click();
cy.get(".primary-workspace .graph-wrapper").should("have.length", 2);
cy.get(".primary-workspace .graph-wrapper .editable-tile-title-text").eq(1).should("contain", categoricalGraphCopyName);
cy.get(".primary-workspace .graph-wrapper").eq(1).find("g.graph-dot").should("have.length", 2).each(($g) => {
graphTile.getTile().should("have.length", 2);
graphTile.getXYPlotTitle().eq(1).should("contain", categoricalGraphCopyName);
graphTile.getTile().eq(1).find("g.graph-dot").should("have.length", 2).each(($g) => {
cy.wrap($g).should("have.attr", "transform").should("not.be.empty");
});

Expand Down

0 comments on commit 2f98e82

Please sign in to comment.