view-account.spec.ts 739 B

123456789101112131415161718192021
  1. // Copyright (C) 2012-2022 Zammad Foundation, https://zammad-foundation.org/
  2. import { visitView } from '@tests/support/components/visitView'
  3. import { mockAccount } from '@tests/support/mock-account'
  4. describe('account page', () => {
  5. // TODO pretty much static page, not a lot of tests needed for now
  6. it('can view my account page', async () => {
  7. mockAccount({
  8. lastname: 'Doe',
  9. firstname: 'John',
  10. })
  11. const view = await visitView('/account')
  12. const mainContent = view.getByTestId('appMain')
  13. expect(mainContent, 'have avatar').toHaveTextContent('JD')
  14. expect(mainContent, 'have my name').toHaveTextContent('John Doe')
  15. expect(mainContent, 'have logout button').toHaveTextContent('Sign out')
  16. })
  17. })