import {
  SearchHandler
} from "./chunk-5OUTR67M.js";
import {
  require_tape
} from "./chunk-QWOE5YTB.js";
import "./chunk-SA7APTJR.js";
import "./chunk-HJ6L54YS.js";
import "./chunk-LSEFWW72.js";
import "./chunk-SKREEF3H.js";
import "./chunk-HYOEWQ5P.js";
import "./chunk-HBW42TDT.js";
import "./chunk-G6O3URDN.js";
import "./chunk-FN5XPUPH.js";
import "./chunk-IIT367QZ.js";
import "./chunk-RZGEKL77.js";
import "./chunk-UI7OCM2A.js";
import "./chunk-YZK37YCC.js";
import "./chunk-7EMWHCVW.js";
import "./chunk-7IYJZZQI.js";
import "./chunk-M3J4MINX.js";
import "./chunk-PF4DSFDR.js";
import "./chunk-QH6W3NVF.js";
import {
  TermTypes
} from "./chunk-NOEAT6CX.js";
import "./chunk-4UWS5Y3N.js";
import "./chunk-DD4R5P6W.js";
import "./chunk-JNITUVXP.js";
import "./chunk-KSGA62R2.js";
import "./chunk-LOZEKOES.js";
import "./chunk-TOU7EVFQ.js";
import "./chunk-OAWQ6LOO.js";
import "./chunk-TLT4YIG3.js";
import "./chunk-KYBIQBXE.js";
import "./chunk-I6Y4O3RR.js";
import "./chunk-OMR2DT66.js";
import "./chunk-DQC5FFGV.js";
import {
  __toESM
} from "./chunk-HFNDKYVF.js";

// termdb/handlers/test/geneExpression.unit.spec.ts
var import_tape = __toESM(require_tape(), 1);
(0, import_tape.default)("\n", function(test) {
  test.comment("-***- termdb/handlers/geneExpression -***-");
  test.end();
});
(0, import_tape.default)("selectGene() should throw when no gene is selected", async (test) => {
  const handler = new SearchHandler();
  handler.app = { vocabApi: { termdbConfig: { queries: { geneExpression: {} } } } };
  handler.callback = () => {
  };
  try {
    await handler.selectGene(void 0);
    test.fail("Should throw when no gene is selected");
  } catch (e) {
    test.match(String(e), /No gene selected/, "Should throw expected message when gene is missing");
  }
  test.end();
});
(0, import_tape.default)("selectGene() should call callback with configured unit from termdbConfig", async (test) => {
  const handler = new SearchHandler();
  let selected;
  handler.callback = (t) => {
    selected = t;
  };
  handler.app = {
    vocabApi: {
      termdbConfig: {
        queries: {
          geneExpression: { unit: "log2 TPM" }
        }
      }
    }
  };
  await handler.selectGene("TP53");
  test.equal(selected?.gene, "TP53", "Should pass selected gene");
  test.equal(selected?.name, "TP53 log2 TPM", "Should include configured unit in term name");
  test.equal(selected?.type, TermTypes.GENE_EXPRESSION, "Should set type to geneExpression");
  test.end();
});
(0, import_tape.default)("selectGene() should use default unit when not configured", async (test) => {
  const handler = new SearchHandler();
  let selected;
  handler.callback = (t) => {
    selected = t;
  };
  handler.app = {
    vocabApi: {
      termdbConfig: {
        queries: {}
      }
    }
  };
  await handler.selectGene("BRCA1");
  test.equal(selected?.gene, "BRCA1", "Should pass selected gene");
  test.equal(selected?.name, "BRCA1 Gene Expression", "Should use default unit when config unit is not provided");
  test.equal(selected?.type, TermTypes.GENE_EXPRESSION, "Should set type to geneExpression");
  test.end();
});
//# sourceMappingURL=geneExpression.unit.spec-G7BSHJQT.js.map
