Rename value of enum type to following

As discussed in our daily standup with @mattwr18
This commit is contained in:
Robert Schäfer 2019-06-05 18:34:02 +02:00
parent 0d8a748094
commit d59c43330b
4 changed files with 8 additions and 8 deletions

View File

@ -65,7 +65,7 @@ describe('FilterBubble middleware', () => {
describe('filtering for posts of followed users only', () => {
it('returns only posts authored by followed users', async () => {
const query = '{ Post( filterBubble: { author: followed }) { title } }'
const query = '{ Post( filterBubble: { author: following }) { title } }'
const expected = {
Post: [{ title: 'This is the post of a followed user' }],
}

View File

@ -4,9 +4,9 @@ export default async function replaceParams(args, context) {
const { author = 'all' } = args.filterBubble || {}
const { user } = context
if (author === 'followed') {
if (author === 'following') {
if (!user)
throw new UserInputError("You are unauthenticated - I don't know your followed users")
throw new UserInputError("You are unauthenticated - I don't know any users you are following.")
const session = context.driver.session()
let { records } = await session.run(

View File

@ -38,9 +38,9 @@ describe('replaceParams', () => {
context.user = null
})
describe('{ filterBubble: { author: followed } }', () => {
describe('{ filterBubble: { author: following } }', () => {
it('throws error', async () => {
args = { filterBubble: { author: 'followed' } }
args = { filterBubble: { author: 'following' } }
await expect(action()).rejects.toThrow('You are unauthenticated')
})
})
@ -63,9 +63,9 @@ describe('replaceParams', () => {
context.user = { id: 'u4711' }
})
describe('{ filterBubble: { author: followed } }', () => {
describe('{ filterBubble: { author: following } }', () => {
beforeEach(() => {
args = { filterBubble: { author: 'followed' } }
args = { filterBubble: { author: 'following' } }
})
it('returns args object with resolved ids of followed users', async () => {

View File

@ -1,5 +1,5 @@
enum FilterBubbleAuthorEnum {
followed
following
all
}