Skip to content

Commit

Permalink
test fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
tnrich committed Dec 16, 2024
1 parent b1d711d commit b0f357d
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 13 deletions.
2 changes: 1 addition & 1 deletion packages/ove/cypress/e2e/cutsiteInfoView.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ describe("cutsiteInfoView", function () {
cy.get(`[data-test="cutsiteToolDropdown"]`).click();
cy.get(`.veToolbarCutsiteFilterHolder input`).type("{selectAll}esp3i");
cy.contains(`These Hidden enzymes match`);
cy.contains("Esp3I (2 cuts)").click();
cy.contains("Esp3I (2 cuts)").click({ force: true });
cy.get(`.veToolbarCutsiteFilterHolder input`).should("not.exist"); //clicking the hidden enzyme should close the filter
cy.contains("Esp3I (2 cuts) hidden");
cy.get(
Expand Down
2 changes: 1 addition & 1 deletion packages/ove/cypress/e2e/oligoMode.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ describe("oligo mode editing in OVE", function () {
// eslint-disable-next-line cypress/no-unnecessary-waiting
cy.wait(0);
cy.focused().type("gatccaauu{enter}");
cy.contains("Selecting 10 bps from 10 to 19"); //the t's should be filtered out
cy.contains("Selecting 9 bps from 10 to 18");
cy.contains("gatccaauu");
cy.get(".veTabProperties").click();
cy.contains("Circular/Linear:").should("not.exist");
Expand Down
5 changes: 3 additions & 2 deletions packages/ove/cypress/e2e/properties.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,12 @@ describe("properties", function () {
cy.get(`.tgDeleteAnnsBtn`).should("not.have.class", "bp3-disabled").click();

cy.get(`.tgDeleteAnnsBtn`).should("have.class", "bp3-disabled");

cy.get(".tgNewAnnBtn").should("not.have.class", "bp3-disabled");
cy.get(".tg-menu-bar").contains("Edit").click();
cy.get(".tg-menu-bar-popover").contains("Select All").click();
cy.get(".veSelectionLayer").first().trigger("contextmenu", { force: true });
cy.get(
".veSelectionLayer:contains(Selecting 5299 bps from 1 to 5299)"
).trigger("contextmenu", { force: true });
cy.get(".bp3-menu-item").contains("Cut").realClick();
cy.get(".tgNewAnnBtn").should("have.class", "bp3-disabled");
});
Expand Down
15 changes: 8 additions & 7 deletions packages/ove/src/withEditorInteractions/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -602,8 +602,13 @@ function VectorInteractionHOC(Component /* options */) {
return new Clipboard(`.${className}`, {
action: () => action,
text: () => {
const { selectionLayer, editorName, store } = this.props;
const { sequenceData, copyOptions } =
if (action === "copy") {
document.body.addEventListener("copy", this.handleCopy);
} else {
document.body.addEventListener("cut", this.handleCut);
}
const { editorName, store } = this.props;
const { sequenceData, copyOptions, selectionLayer } =
store.getState().VectorEditor[editorName];

const selectedSeqData = getSequenceDataBetweenRange(
Expand All @@ -628,11 +633,7 @@ function VectorInteractionHOC(Component /* options */) {
sequenceData
);
this.sequenceDataToCopy = sequenceDataToCopy;
if (action === "copy") {
document.body.addEventListener("copy", this.handleCopy);
} else {
document.body.addEventListener("cut", this.handleCut);
}

if (window.Cypress) {
window.Cypress.textToCopy = sequenceDataToCopy.textToCopy;
window.Cypress.seqDataToCopy = sequenceDataToCopy;
Expand Down
6 changes: 4 additions & 2 deletions packages/ui/cypress/e2e/EditableCellTable.spec.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import path from "path";
import os from "os";

describe("EditableCellTable.spec", () => {
it(`cell checkboxes and the header checkbox should work`, () => {
Expand Down Expand Up @@ -240,8 +241,9 @@ describe("EditableCellTable.spec", () => {
);
});
it(`undo/redo should work`, () => {
const undoCmd = [`Meta`, `z`];
const redoCmd = [`Meta`, `Shift`, `z`];
const IS_LINUX = os.platform().toLowerCase().search("linux") > -1;
const undoCmd = IS_LINUX ? [`Alt`, `z`] : [`Meta`, `z`];
const redoCmd = IS_LINUX ? [`Alt`, `Shift`, `z`] : [`Meta`, `Shift`, `z`];
cy.visit("#/DataTable%20-%20EditableCellTable");
cy.get(`.rt-td:contains(tom88)`).dblclick();
cy.focused().type("{selectall}tasty55{enter}");
Expand Down

0 comments on commit b0f357d

Please sign in to comment.