/* eslint-disable promise/always-return */
import { resolve } from "path"
import { readFileSync } from "fs"
import { runAuthenticatedQuery } from "schema/v2/test/utils"
import gql from "lib/gql"

it("returns artworks for a collection", () => {
  const genesPath = resolve(
    "src",
    "test",
    "fixtures",
    "gravity",
    "follow_genes.json"
  )
  const genes = JSON.parse(readFileSync(genesPath, "utf8"))

  const followedGenesLoader = sinon
    .stub()
    .withArgs("me/follow/genes", { size: 10, offset: 0, total_count: true })
    .returns(Promise.resolve({ body: genes, headers: { "x-total-count": 10 } }))

  const query = gql`
    {
      me {
        followedGenes(first: 10) {
          edges {
            node {
              gene {
                name
                slug
              }
            }
          }
        }
      }
    }
  `
  return runAuthenticatedQuery(query, { followedGenesLoader }).then(data => {
    expect(data).toMatchSnapshot()
  })
})

@@ -668,23 +668,53 @@
   follow
-edGenes
+sAndSaves %7B%0A          genesConnection
 (first: 
@@ -719,16 +719,18 @@
 : 10) %7B%0A
+  
         
@@ -751,16 +751,18 @@
         
+  
 node %7B%0A 
@@ -778,15 +778,19 @@
     
+ 
+ 
 gene %7B%0A
+  
     
@@ -826,13 +826,33 @@
     
+  
 slug%0A
+                %7D%0A
     

Fix v2 followed_categories test