Skip to content

Commit

Permalink
Merge pull request #133 from TeselaGen/chromError
Browse files Browse the repository at this point in the history
chore: bump version to 0.7.18 and add error handling for missing base…
  • Loading branch information
tnrich authored Jan 31, 2025
2 parents 2ad00ad + b408395 commit 4abc33c
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 8 deletions.
10 changes: 5 additions & 5 deletions output.json
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@
"inputs": ["default", "^production"],
"executor": "nx:run-commands",
"options": {
"command": "cd packages/bounce-loader && npx playwright test"
"command": "cd packages/bounce-loader && yarn playwright test"
},
"configurations": {}
},
Expand All @@ -155,7 +155,7 @@
"inputs": ["default", "^production"],
"executor": "nx:run-commands",
"options": {
"command": "nx run bounce-loader:start & cd packages/bounce-loader && npx playwright test --ui"
"command": "nx run bounce-loader:start & cd packages/bounce-loader && yarn playwright test --ui"
},
"configurations": {}
},
Expand All @@ -169,14 +169,14 @@
"launch-e2e2": {
"executor": "nx:run-commands",
"options": {
"command": "npx concurrently -k \"wait-on tcp:4200 && cd packages/bounce-loader && yarn cypress open --e2e --browser chrome\" \"nx run bounce-loader:start\""
"command": "yarn concurrently -k \"wait-on tcp:4200 && cd packages/bounce-loader && yarn cypress open --e2e --browser chrome\" \"nx run bounce-loader:start\""
},
"configurations": {}
},
"e2e2": {
"executor": "nx:run-commands",
"options": {
"command": "npx concurrently --kill-others --kill-signal SIGKILL --success first \"npx wait-on tcp:4200 && cd packages/bounce-loader && yarn cypress run --record --config --e2e\" \"nx run bounce-loader:start\" "
"command": "yarn concurrently --kill-others --kill-signal SIGKILL --success first \"yarn wait-on tcp:4200 && cd packages/bounce-loader && yarn cypress run --record --config --e2e\" \"nx run bounce-loader:start\" "
},
"configurations": {}
},
Expand Down Expand Up @@ -665,7 +665,7 @@
"launch-e2e-playwright": {
"executor": "nx:run-commands",
"options": {
"command": "nx run ove:start:ci & cd packages/ove && npx playwright test --ui"
"command": "nx run ove:start:ci & cd packages/ove && yarn playwright test --ui"
},
"configurations": {}
}
Expand Down
13 changes: 13 additions & 0 deletions packages/ove/cypress/e2e/chromatogram.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,19 @@ describe("chromatogram", function () {
});
});
});

it("should throw an error if baseTraces are missing from chromatogram data", function () {
window.Cypress.triggerMissingBaseTrace = true;
cy.visit("#/Editor?chromatogramExample=true");

cy.on("uncaught:exception", err => {
expect(err.message).to.include(
'Chromatogram data is missing "baseTraces"'
);
return false;
});
});

it("right clicking a chromatogram should give the option to hide quality scores", function () {
cy.visit("#/Editor?chromatogramExample=true");
cy.get(".chromatogram").first().rightclick();
Expand Down
5 changes: 4 additions & 1 deletion packages/ove/demo/src/EditorDemo/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -1728,7 +1728,10 @@ additionalEnzymes: {
id: "1",
// chromatogramData: example1Ab1,
// sequence: example1Ab1.baseCalls.join(""),
chromatogramData: chromData,
chromatogramData: window.Cypress
?.triggerMissingBaseTrace
? _chromData
: chromData,
sequence: chromData.baseCalls.join(""),
features: [
{
Expand Down
2 changes: 1 addition & 1 deletion packages/ove/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@teselagen/ove",
"version": "0.7.17",
"version": "0.7.18",
"main": "./src/index.js",
"type": "module",
"exports": {
Expand Down
6 changes: 5 additions & 1 deletion packages/ove/src/RowItem/Chromatograms/Chromatogram.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,11 @@ export default function Chromatogram(props) {
canvasRef
]);
const marginLeft = gapsBeforeRow * charWidth;

if (chromatogramData.basePos && !chromatogramData.baseTraces) {
throw new Error(
'Chromatogram data is missing "baseTraces". Be sure to call the convertBasePosTraceToPerBpTrace(_chromData) before passing it to the editor'
);
}
return (
<div
className={classNames("chromatogram", {
Expand Down

0 comments on commit 4abc33c

Please sign in to comment.