forked from cybrespace/pinafore
add test for account profiles
This commit is contained in:
parent
dc1a42ed29
commit
689c00bd4f
|
@ -0,0 +1,41 @@
|
||||||
|
describe('07-account-profile.js', () => {
|
||||||
|
beforeEach(() => {
|
||||||
|
cy.login('foobar@localhost:3000', 'foobarfoobar')
|
||||||
|
cy.wait(500)
|
||||||
|
})
|
||||||
|
|
||||||
|
it('shows account profile', () => {
|
||||||
|
cy.get('.status-author-name').contains('quux').click()
|
||||||
|
cy.url().should('contain', '/accounts/3')
|
||||||
|
cy.wait(500)
|
||||||
|
cy.get('.account-profile .account-profile-name').should('contain', 'quux')
|
||||||
|
cy.get('.account-profile .account-profile-username').should('contain', '@quux')
|
||||||
|
cy.get('.account-profile .account-profile-followed-by').should('contain', 'Follows you')
|
||||||
|
cy.get('.account-profile .account-profile-follow button')
|
||||||
|
.should('have.attr', 'aria-label', 'Follow')
|
||||||
|
.and('have.attr', 'aria-pressed', 'false')
|
||||||
|
})
|
||||||
|
|
||||||
|
it('shows account profile 2', () => {
|
||||||
|
cy.get('.status-author-name').contains('admin').click()
|
||||||
|
cy.url().should('contain', '/accounts/1')
|
||||||
|
cy.wait(500)
|
||||||
|
cy.get('.account-profile .account-profile-name').should('contain', 'admin')
|
||||||
|
cy.get('.account-profile .account-profile-username').should('contain', '@admin')
|
||||||
|
cy.get('.account-profile .account-profile-followed-by').should('contain', 'Follows you')
|
||||||
|
cy.get('.account-profile .account-profile-follow button')
|
||||||
|
.should('have.attr', 'aria-label', 'Unfollow')
|
||||||
|
.and('have.attr', 'aria-pressed', 'true')
|
||||||
|
})
|
||||||
|
|
||||||
|
it('shows account profile 3', () => {
|
||||||
|
cy.get('.mention').contains('foobar').click()
|
||||||
|
cy.url().should('contain', '/accounts/2')
|
||||||
|
cy.wait(500)
|
||||||
|
cy.get('.account-profile .account-profile-name').should('contain', 'foobar')
|
||||||
|
cy.get('.account-profile .account-profile-username').should('contain', '@foobar')
|
||||||
|
// can't follow or be followed by your own account
|
||||||
|
cy.get('.account-profile .account-profile-followed-by').should('be.empty')
|
||||||
|
cy.get('.account-profile .account-profile-follow').should('be.empty')
|
||||||
|
})
|
||||||
|
})
|
|
@ -8,7 +8,7 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="account-profile-name">
|
<div class="account-profile-name">
|
||||||
<ExternalLink href="{{profile.url}}" showIcon="true" normalIconColor="true">
|
<ExternalLink href="{{profile.url}}" showIcon="true" normalIconColor="true">
|
||||||
{{profile.display_name}}
|
{{profile.display_name || profile.acct}}
|
||||||
</ExternalLink>
|
</ExternalLink>
|
||||||
</div>
|
</div>
|
||||||
<div class="account-profile-username">
|
<div class="account-profile-username">
|
||||||
|
@ -24,8 +24,10 @@
|
||||||
<div class="account-profile-follow">
|
<div class="account-profile-follow">
|
||||||
{{#if verifyCredentials && relationship && verifyCredentials.id !== relationship.id}}
|
{{#if verifyCredentials && relationship && verifyCredentials.id !== relationship.id}}
|
||||||
<IconButton
|
<IconButton
|
||||||
label="{{relationship && relationship.following ? 'Unfollow' : 'Follow'}}"
|
label="{{following ? 'Unfollow' : 'Follow'}}"
|
||||||
href="{{relationship && relationship.following ? '#fa-user-times' : '#fa-user-plus'}}"
|
href="{{following ? '#fa-user-times' : '#fa-user-plus'}}"
|
||||||
|
pressable="true"
|
||||||
|
pressed="{{following}}"
|
||||||
big="true"
|
big="true"
|
||||||
/>
|
/>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
@ -195,7 +197,8 @@
|
||||||
note = `<p>${note}</p>`
|
note = `<p>${note}</p>`
|
||||||
}
|
}
|
||||||
return note
|
return note
|
||||||
}
|
},
|
||||||
|
following: (relationship) => relationship && relationship.following
|
||||||
},
|
},
|
||||||
store: () => store,
|
store: () => store,
|
||||||
components: {
|
components: {
|
||||||
|
|
Loading…
Reference in New Issue