Skip to content
This repository has been archived by the owner on Jan 22, 2024. It is now read-only.

Commit

Permalink
updating tests to use new molecule type select instead of old isProtein
Browse files Browse the repository at this point in the history
  • Loading branch information
tnrich committed Jun 17, 2021
1 parent 27a4749 commit 112d8f8
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 17 deletions.
6 changes: 3 additions & 3 deletions cypress/integration/copyPaste.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ describe("copyPaste", function () {
cy.visit("");
});
// it(`isProtein mode - copy via hotkey`, () => {
// cy.tgToggle("isProtein");
// cy.contains(".tg-menu-bar button", "Edit").click();
// cy.contains(".bp3-menu-item", "Copy").click();
// cy.window().then(() => {
Expand All @@ -18,7 +17,8 @@ describe("copyPaste", function () {
// });
// });
it(`isProtein mode - copy genbank of protein`, () => {
cy.tgToggle("isProtein");
cy.get(`[data-test="moleculeType"]`).select("Protein");

cy.contains(".veRowViewFeature", "araC")
.first()
.trigger("contextmenu", { force: true });
Expand All @@ -37,7 +37,7 @@ describe("copyPaste", function () {
});
});
it(`isProtein mode - copy protein sequence`, () => {
cy.tgToggle("isProtein");
cy.get(`[data-test="moleculeType"]`).select("Protein");
cy.contains(".veRowViewFeature", "araC")
.first()
.trigger("contextmenu", { force: true });
Expand Down
6 changes: 3 additions & 3 deletions cypress/integration/proteinEditor.spec.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
describe("proteinEditor", function () {
beforeEach(() => {
cy.visit("");
cy.tgToggle("isProtein");
cy.visit("/#/Editor?moleculeType=Protein");
// cy.get(`[data-test="moleculeType"]`).select('Protein')
});
it(`annotations shouldn't have a strand field to edit and all annotations be 'forward'`, () => {
cy.contains(".veRowViewPart", "Part 0").rightclick();
Expand All @@ -16,7 +16,7 @@ describe("proteinEditor", function () {
});
it(`should be able to toggle between protein and dna mode after firing some actions`, () => {
cy.contains(".veLabelText", "Part 0").click();
cy.tgToggle("isProtein", false);
cy.get(`[data-test="moleculeType"]`).select("DNA");
cy.contains("Length: 5299 bps").should("exist");
});
it(`feature/part add/edit should be AA indexed`, () => {
Expand Down
16 changes: 6 additions & 10 deletions demo/src/EditorDemo/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -268,8 +268,7 @@ export default class EditorDemo extends React.Component {
renderToggle({
that: this,
type: "generatePng",
info:
"Passing generatePng=true will cause a .png image of the map to be output for optional download within the onSave handler (It will be returned as part of the first argument of the onSave handler under the key 'pngFile')."
info: "Passing generatePng=true will cause a .png image of the map to be output for optional download within the onSave handler (It will be returned as part of the first argument of the onSave handler under the key 'pngFile')."
}),
renderToggle({
that: this,
Expand All @@ -286,14 +285,12 @@ export default class EditorDemo extends React.Component {
renderToggle({
that: this,
type: "onCreateNewFromSubsequence",
info:
"Passing a onCreateNewFromSubsequence handler will add the option for the user to create a new sequence from a selection of the sequence. The handler implementer will need to handle the actual steps that follow this"
info: "Passing a onCreateNewFromSubsequence handler will add the option for the user to create a new sequence from a selection of the sequence. The handler implementer will need to handle the actual steps that follow this"
}),
renderToggle({
that: this,
type: "onDelete",
info:
"This onDelete callback is for deletion of the *entire* sequence from the menu bar. OVE has no default handler for full sequence delete"
info: "This onDelete callback is for deletion of the *entire* sequence from the menu bar. OVE has no default handler for full sequence delete"
}),
renderToggle({
that: this,
Expand Down Expand Up @@ -442,6 +439,7 @@ updateEditor(store, "DemoEditor", {
isSelect: true,
options: ["DNA", "RNA", "Protein"],
that: this,
label: "Molecule Type:",
type: "moleculeType",
info: `
The editor supports Amino Acid sequences and RNA sequences as well as DNA sequences!
Expand Down Expand Up @@ -754,15 +752,13 @@ rightClickOverrides: {
that: this,
type: "forceHeightMode",
label: "Force Height 500px",
info:
"You can force a height for the editor by passing `height:500` (same for width) "
info: "You can force a height for the editor by passing `height:500` (same for width) "
})}
{renderToggle({
that: this,
type: "adjustCircularLabelSpacing",
label: "Adjust circular label spacing",
info:
"You can adjust the spacing between labels in circular view as a function of the multiple of the font height by passing `fontHeightMultiplier: 2` (value is restricted to between 1.5 and 3.5; default is 2.4, 2.0 when toggle is true)"
info: "You can adjust the spacing between labels in circular view as a function of the multiple of the font height by passing `fontHeightMultiplier: 2` (value is restricted to between 1.5 and 3.5; default is 2.4, 2.0 when toggle is true)"
})}
{renderToggle({
that: this,
Expand Down
3 changes: 2 additions & 1 deletion demo/src/utils/renderToggle.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,10 @@ export default function renderToggle({
/>
);
} else if (isSelect) {
const { style, ...rest } = sharedProps;
const { style, label, ...rest } = sharedProps;
toggleOrButton = (
<div style={sharedProps.style}>
{label && <span>{label} &nbsp;</span>}
<EnhancedSelect
{...{
options,
Expand Down

0 comments on commit 112d8f8

Please sign in to comment.