mirror of
https://github.com/IT4Change/Ocelot-Social.git
synced 2025-12-13 07:45:56 +00:00
specs for Search for Hashtags
This commit is contained in:
parent
7024ea0b30
commit
4e3705f607
@ -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',
|
||||
},
|
||||
],
|
||||
},
|
||||
})
|
||||
})
|
||||
})
|
||||
})
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user