specs for Search for Hashtags

This commit is contained in:
Moriz Wahl 2020-03-19 15:10:52 +01:00
parent 7024ea0b30
commit 4e3705f607

View File

@ -41,6 +41,9 @@ const searchQuery = gql`
slug
name
}
... on Tag {
id
}
}
}
`
@ -439,6 +442,28 @@ und hinter tausend Stäben keine Welt.`,
})
})
})
describe('adding a tag', () => {
beforeAll(async () => {
await Factory.build('tag', { id: 'myHashtag' })
})
describe('query the first four characters of the tag', () => {
it('finds the tag', async () => {
variables = { query: 'myha' }
await expect(query({ query: searchQuery, variables })).resolves.toMatchObject({
data: {
findResources: [
{
__typename: 'Tag',
id: 'myHashtag',
},
],
},
})
})
})
})
})
})
})