mirror of
https://github.com/IT4Change/Ocelot-Social.git
synced 2025-12-13 07:45:56 +00:00
Rename value of enum type to following
As discussed in our daily standup with @mattwr18
This commit is contained in:
parent
0d8a748094
commit
d59c43330b
@ -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' }],
|
||||
}
|
||||
|
||||
@ -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(
|
||||
|
||||
@ -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 () => {
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
enum FilterBubbleAuthorEnum {
|
||||
followed
|
||||
following
|
||||
all
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user