mirror of
https://github.com/IT4Change/Ocelot-Social.git
synced 2025-12-13 07:45:56 +00:00
Follow @mattwr18 code review 👍
This commit is contained in:
parent
10ae4abaae
commit
ef46f71c0d
@ -12,7 +12,12 @@ afterEach(async () => {
|
|||||||
|
|
||||||
describe('users', () => {
|
describe('users', () => {
|
||||||
describe('User', () => {
|
describe('User', () => {
|
||||||
const query = `query($email: String) { User(email: $email) { id } }`
|
describe('query by email address', () => {
|
||||||
|
beforeEach(async () => {
|
||||||
|
await factory.create('User', { name: 'Johnny', email: 'any-email-address@example.org' })
|
||||||
|
})
|
||||||
|
|
||||||
|
const query = `query($email: String) { User(email: $email) { name } }`
|
||||||
const variables = { email: 'any-email-address@example.org' }
|
const variables = { email: 'any-email-address@example.org' }
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
client = new GraphQLClient(host)
|
client = new GraphQLClient(host)
|
||||||
@ -36,7 +41,10 @@ describe('users', () => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
it('is permitted', async () => {
|
it('is permitted', async () => {
|
||||||
await expect(client.request(query, variables)).resolves.toEqual({ User: [] })
|
await expect(client.request(query, variables)).resolves.toEqual({
|
||||||
|
User: [{ name: 'Johnny' }],
|
||||||
|
})
|
||||||
|
})
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|||||||
@ -141,7 +141,7 @@ type Query {
|
|||||||
first: Int
|
first: Int
|
||||||
offset: Int
|
offset: Int
|
||||||
orderBy: [_UserOrdering]
|
orderBy: [_UserOrdering]
|
||||||
filter: _UserFilter # adding this would expose email
|
filter: _UserFilter
|
||||||
): [User]
|
): [User]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user