mirror of
https://git.shipoclu.com/moon/plspace.git
synced 2026-08-13 02:42:30 +00:00
greentext
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import { fireEvent, render, waitFor } from '@testing-library/svelte'
|
||||
import { describe, expect, it, vi } from 'vitest'
|
||||
import { APP_SERVICES } from '$lib/app-services'
|
||||
import { account, session, status, testServices } from '$test/fixtures'
|
||||
import { account, preferences, session, status, testServices } from '$test/fixtures'
|
||||
import BlogEntry from './BlogEntry.svelte'
|
||||
|
||||
function renderEntry(overrides: Parameters<typeof status>[0]) {
|
||||
@@ -67,6 +67,40 @@ describe('BlogEntry MFM rendering', () => {
|
||||
})
|
||||
})
|
||||
|
||||
describe('BlogEntry Heleneposting', () => {
|
||||
it('replaces only the displayed author name and avatar when enabled', () => {
|
||||
const original = account({
|
||||
acct: 'actual-author',
|
||||
display_name: 'Actual Author',
|
||||
avatar: 'https://example.test/actual.png',
|
||||
avatar_static: 'https://example.test/actual.png',
|
||||
})
|
||||
const services = testServices({
|
||||
preferences: preferences({ heleneposting: true }),
|
||||
})
|
||||
const view = render(BlogEntry, {
|
||||
props: {
|
||||
status: status({
|
||||
account: original,
|
||||
content: '<p>Signed through <em>HTML</em><br>— Helene</p>',
|
||||
}),
|
||||
},
|
||||
context: new Map([[APP_SERVICES, services]]),
|
||||
})
|
||||
|
||||
expect(view.container.querySelector('.blog-entry-author')).toHaveAttribute(
|
||||
'href',
|
||||
'#/@actual-author',
|
||||
)
|
||||
expect(view.queryByText('Actual Author')).not.toBeInTheDocument()
|
||||
expect(view.container.querySelector('.blog-entry-avatar img')).toHaveAttribute(
|
||||
'src',
|
||||
expect.stringContaining('helene'),
|
||||
)
|
||||
expect(view.getByText('@actual-author@example.test')).toBeInTheDocument()
|
||||
})
|
||||
})
|
||||
|
||||
describe('BlogEntry quote posts', () => {
|
||||
it('renders a Pleroma quote and links to quote composition and the quote list', () => {
|
||||
const quoted = status({
|
||||
|
||||
Reference in New Issue
Block a user