mirror of
https://git.shipoclu.com/moon/plspace.git
synced 2026-08-13 02:42:30 +00:00
quote posts
This commit is contained in:
@@ -67,6 +67,61 @@ describe('BlogEntry MFM rendering', () => {
|
||||
})
|
||||
})
|
||||
|
||||
describe('BlogEntry quote posts', () => {
|
||||
it('renders a Pleroma quote and links to quote composition and the quote list', () => {
|
||||
const quoted = status({
|
||||
id: 'quoted-entry',
|
||||
content: '<p>Quoted words</p>',
|
||||
account: account({ id: 'quoted-author', display_name: 'Quoted Author' }),
|
||||
})
|
||||
const outer = status({
|
||||
id: 'outer-entry',
|
||||
content: '<p>My commentary</p>',
|
||||
quotes_count: 3,
|
||||
pleroma: { quote: quoted, quote_id: quoted.id, quote_visible: true },
|
||||
})
|
||||
const services = testServices({
|
||||
session: session({ signedIn: true, token: 'token', me: account() }),
|
||||
})
|
||||
const view = render(BlogEntry, {
|
||||
props: { status: outer },
|
||||
context: new Map([[APP_SERVICES, services]]),
|
||||
})
|
||||
|
||||
expect(view.getByText('Quoted words')).toBeInTheDocument()
|
||||
expect(view.getByRole('link', { name: 'Quote' })).toHaveAttribute(
|
||||
'href',
|
||||
'#/compose?quote=outer-entry',
|
||||
)
|
||||
expect(view.getByRole('link', { name: 'Quotes (3)' })).toHaveAttribute(
|
||||
'href',
|
||||
'#/blog/outer-entry/quotes',
|
||||
)
|
||||
})
|
||||
|
||||
it('shows a Mastodon quote authorization placeholder without leaking content', () => {
|
||||
const hidden = status({ id: 'hidden-quote', content: '<p>Do not display me</p>' })
|
||||
const view = renderEntry({
|
||||
quote: { state: 'blocked_account', quoted_status: hidden },
|
||||
})
|
||||
|
||||
expect(view.getByText('The quoted account is blocked.')).toBeInTheDocument()
|
||||
expect(view.queryByText('Do not display me')).not.toBeInTheDocument()
|
||||
})
|
||||
|
||||
it('does not offer quoting when Mastodon says the viewer is denied', () => {
|
||||
const view = renderEntry({
|
||||
quote_approval: {
|
||||
automatic: [],
|
||||
manual: [],
|
||||
current_user: 'denied',
|
||||
},
|
||||
})
|
||||
|
||||
expect(view.queryByRole('link', { name: 'Quote' })).not.toBeInTheDocument()
|
||||
})
|
||||
})
|
||||
|
||||
describe('BlogEntry emoji reactions', () => {
|
||||
it('collapses the reaction bar when the entry has no reactions', () => {
|
||||
const view = renderEntry({ pleroma: { emoji_reactions: [] } })
|
||||
|
||||
Reference in New Issue
Block a user