mirror of
https://github.com/IT4Change/Ocelot-Social.git
synced 2025-12-13 07:45:56 +00:00
Fix lint
This commit is contained in:
parent
6b5d329759
commit
cadb309ecf
@ -16,11 +16,11 @@ describe('filter for searchQuery', () => {
|
||||
describe('given some posts', () => {
|
||||
beforeEach(async () => {
|
||||
await create('post', {
|
||||
title: 'Hamlet',
|
||||
title: 'Hamlet',
|
||||
content: 'To be, or not to be: that is the question'
|
||||
})
|
||||
await create('post', {
|
||||
title: 'Threepenny Opera',
|
||||
title: 'Threepenny Opera',
|
||||
content: 'And the shark, it has teeth, And it wears them in the face.'
|
||||
})
|
||||
})
|
||||
@ -35,9 +35,8 @@ describe('filter for searchQuery', () => {
|
||||
MATCH (n) OPTIONAL MATCH (n)-[r]-() DELETE n,r;
|
||||
CALL db.index.fulltext.queryNodes('full_text_search', ''
|
||||
`))
|
||||
console.log(data)
|
||||
const data = await request(host, query('the'))
|
||||
expect(data).toEqual({findPosts: [{title: 'Hamlet'}, {title: 'Threepenny Opera'}]})
|
||||
expect(data).toEqual({ findPosts: [{ title: 'Hamlet' }, { title: 'Threepenny Opera' }] })
|
||||
})
|
||||
})
|
||||
|
||||
@ -45,17 +44,17 @@ describe('filter for searchQuery', () => {
|
||||
describe('includes posts if search term', () => {
|
||||
it('matches title', async () => {
|
||||
const data = await request(host, query('Hamlet'))
|
||||
expect(data).toEqual({findPosts: [{title: 'Hamlet'}]})
|
||||
expect(data).toEqual({ findPosts: [{ title: 'Hamlet' }] })
|
||||
})
|
||||
|
||||
it('matches mistyped title', async () => {
|
||||
const data = await request(host, query('amlet'))
|
||||
expect(data).toEqual({findPosts: [{title: 'Hamlet'}]})
|
||||
expect(data).toEqual({ findPosts: [{ title: 'Hamlet' }] })
|
||||
})
|
||||
|
||||
it('matches a part of the content', async () => {
|
||||
const data = await request(host, query('shark'))
|
||||
expect(data).toEqual({findPosts: [{title: 'Threepenny Opera'}]})
|
||||
expect(data).toEqual({ findPosts: [{ title: 'Threepenny Opera' }] })
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
@ -2,9 +2,9 @@ import faker from 'faker'
|
||||
|
||||
export default function (params) {
|
||||
const {
|
||||
id = Array.from({length: 3}, () => faker.lorem.word()).join(''),
|
||||
id = Array.from({ length: 3 }, () => faker.lorem.word()).join(''),
|
||||
title = faker.lorem.sentence(),
|
||||
content = Array.from({length: 10}, () => faker.lorem.sentence()).join(' ')
|
||||
content = Array.from({ length: 10 }, () => faker.lorem.sentence()).join(' ')
|
||||
} = params
|
||||
return `
|
||||
mutation {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user