<commit_before>import withLinkGenerator from "./withLinkGenerator"

// withLinkGenerator accepts (id, db, name)

describe("withLinkGenerator", () => {
  const fn = withLinkGenerator
  describe("with name parameters", () => {
    it("returns local URL if given gene name", () => {
      expect(fn("Q54QB1", "UniprotKB", "erkB")).toBe("/erkB")
    })
    it("returns local URL if given gene ID", () => {
      expect(fn("Q54QB1", "UniprotKB", "DDB_G0272608")).toBe("/DDB_G0272608")
    })
    it("returns GO URL if given GO name", () => {
      expect(fn("0032496", "GO", "response to lipopolysaccharide")).toBe(
        "https://www.ebi.ac.uk/QuickGO/term/GO:0032496",
      )
    })
    it("returns Uniprot URL if given Uniprot name", () => {
      expect(fn("P68135", "UniprotKB", "P68135")).toBe(
        "https://www.uniprot.org/uniprot/P68135",
      )
    })
  })

  describe("without name parameters", () => {
    it("returns correct CHEBI URL", () => {
      expect(fn("test", "CHEBI")).toBe(
        "https://www.ebi.ac.uk/chebi/searchId.do?chebiId=CHEBI:test",
      )
    })
    it("returns correct DDB URL", () => {
      expect(fn("DDB_G0272608", "DDB")).toBe("/DDB_G0272608")
    })
    it("returns correct dictyBase URL", () => {
      expect(fn("DDB_G0272608", "dictyBase")).toBe("/DDB_G0272608")
    })
    it("returns correct FB URL", () => {
      expect(fn("test", "FB")).toBe("http://flybase.org/reports/test.html")
    })
    it("returns correct GO URL", () => {
      expect(fn("test", "GO")).toBe(
        "https://www.ebi.ac.uk/QuickGO/term/GO:test",
      )
    })
    it("returns correct InterPro URL", () => {
      expect(fn("test", "InterPro")).toBe(
        "http://www.ebi.ac.uk/interpro/entry/test",
      )
    })
    it("returns correct MGI URL", () => {
      expect(fn("test", "MGI")).toBe(
        "http://www.informatics.jax.org/marker/test",
      )
    })
    it("returns correct PANTHER URL", () => {
      expect(fn("test", "PANTHER")).toBe(
        "http://www.pantree.org/node/annotationNode.jsp?id=test",<commit_msg>test: fix broken test<commit_after>import withLinkGenerator from "./withLinkGenerator"

// withLinkGenerator accepts (id, db, name)

describe("withLinkGenerator", () => {
  const fn = withLinkGenerator
  describe("with name parameters", () => {
    it("returns local URL if given gene name", () => {
      expect(fn("Q54QB1", "UniprotKB", "erkB")).toBe(
        "https://testdb.dictybase.org/gene/erkB",
      )
    })
    it("returns local URL if given gene ID", () => {
      expect(fn("Q54QB1", "UniprotKB", "DDB_G0272608")).toBe(
        "https://testdb.dictybase.org/gene/DDB_G0272608",
      )
    })
    it("returns GO URL if given GO name", () => {
      expect(fn("0032496", "GO", "response to lipopolysaccharide")).toBe(
        "https://www.ebi.ac.uk/QuickGO/term/GO:0032496",
      )
    })
    it("returns Uniprot URL if given Uniprot name", () => {
      expect(fn("P68135", "UniprotKB", "P68135")).toBe(
        "https://www.uniprot.org/uniprot/P68135",
      )
    })
  })

  describe("without name parameters", () => {
    it("returns correct CHEBI URL", () => {
      expect(fn("test", "CHEBI")).toBe(
        "https://www.ebi.ac.uk/chebi/searchId.do?chebiId=CHEBI:test",
      )
    })
    it("returns correct DDB URL", () => {
      expect(fn("DDB_G0272608", "DDB")).toBe(
        "https://testdb.dictybase.org/gene/DDB_G0272608",
      )
    })
    it("returns correct dictyBase URL", () => {
      expect(fn("DDB_G0272608", "dictyBase")).toBe(
        "https://testdb.dictybase.org/gene/DDB_G0272608",
      )
    })
    it("returns correct FB URL", () => {
      expect(fn("test", "FB")).toBe("http://flybase.org/reports/test.html")
    })
    it("returns correct GO URL", () => {
      expect(fn("test", "GO")).toBe(
        "https://www.ebi.ac.uk/QuickGO/term/GO:test",
      )
    })
    it("returns correct InterPro URL", () => {
      expect(fn("test", "InterPro")).toBe(
        "http://www.ebi.ac.uk/interpro/entry/test",
      )
    })
    it("returns correct MGI URL", () => {
      expect(fn("test", "MGI")).toBe(
        "http://www.informatics.jax.org/marker/test",
      )
    })
    it("returns correct PANTHER URL", () => {
      expect(fn("test", "PANTHER")).toBe(
        "http://www.pantree.org/node/annotationNode.jsp?id=test",
{'fraction_non_alphanumeric': 0.20808314087759816, 'fraction_numerical': 0.03556581986143187, 'mean_word_length': 2.805799648506151, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 33, 'https://': 12, 'lorem ipsum': 0, 'www.': 14, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2398671', 'n_tokens_mistral': 1663, 'n_tokens_neox': 1542, 'n_words': 238}