Merge pull request #457 from Irev-Dev/kurt/454

Make sure bio updates after saving the profile.
This commit was merged in pull request #457.
This commit is contained in:
Kurt Hutten
2021-08-16 20:32:40 +10:00
committed by GitHub
4 changed files with 3 additions and 52 deletions

View File

@@ -1,6 +0,0 @@
// Define your own mock data here:
export const standard = (/* vars, { ctx, req } */) => ({
editUser: {
id: 42,
},
})

View File

@@ -1,20 +0,0 @@
import { Loading, Empty, Failure, Success } from './EditUserCell'
import { standard } from './EditUserCell.mock'
export const loading = () => {
return Loading ? <Loading /> : null
}
export const empty = () => {
return Empty ? <Empty /> : null
}
export const failure = () => {
return Failure ? <Failure error={new Error('Oh no')} /> : null
}
export const success = () => {
return Success ? <Success {...standard()} /> : null
}
export default { title: 'Cells/EditUserCell' }

View File

@@ -1,26 +0,0 @@
import { render, screen } from '@redwoodjs/testing'
import { Loading, Empty, Failure, Success } from './EditUserCell'
import { standard } from './EditUserCell.mock'
describe('EditUserCell', () => {
test('Loading renders successfully', () => {
render(<Loading />)
// Use screen.debug() to see output
expect(screen.getByText('Loading...')).toBeInTheDocument()
})
test('Empty renders successfully', async () => {
render(<Empty />)
expect(screen.getByText('Empty')).toBeInTheDocument()
})
test('Failure renders successfully', async () => {
render(<Failure error={new Error('Oh no')} />)
expect(screen.getByText(/Oh no/i)).toBeInTheDocument()
})
test('Success renders successfully', async () => {
render(<Success editUser={standard().editUser} />)
expect(screen.getByText(/42/i)).toBeInTheDocument()
})
})

View File

@@ -23,6 +23,9 @@ const UPDATE_USER_MUTATION = gql`
updateUserByUserName(userName: $userName, input: $input) {
id
userName
bio
name
image
}
}
`