import React from "react"
import { render } from "enzyme"
import GeneFamilyNav from "../GeneFamilyNav"

describe("GeneFamilyNav", () => {
  let rendered
  let geneFamilies

  beforeEach(() => {
    geneFamilies = [
      {
        id: "materials",
        name: "Materials",
        genes: [
          /* … */
        ],
      },
      {
        id: "styles",
        name: "Styles",
        genes: [
          /* … */
        ],
      },
    ]
    rendered = render(<GeneFamilyNav geneFamilies={geneFamilies} />)
  })

  it("renders links for each family", () => {
    rendered.find("a").length.should.equal(2)
    rendered
      .find("a")
      .eq(0)
      .text()
      .should.equal("Materials")
    rendered
      .find("a")
      .eq(1)
      .text()
      .should.equal("Styles")
  })
})

@@ -227,16 +227,35 @@
      id:
+ 123,%0A        slug:
  %22materi
@@ -361,16 +361,35 @@
      id:
+ 456,%0A        slug:
  %22styles
@@ -647,39 +647,32 @@
 (2)%0A    rendered
-%0A      
 .find(%22a%22)%0A     
@@ -669,42 +669,21 @@
 %22a%22)
-%0A      .eq(0)%0A      .text()%0A      
+.eq(0).text()
 .sho
@@ -717,23 +717,16 @@
 rendered
-%0A      
 .find(%22a
@@ -731,42 +731,21 @@
 %22a%22)
-%0A      .eq(1)%0A      .text()%0A      
+.eq(1).text()
 .sho

fix a map/key warning by correcting fixture