Merge pull request #211 from cloudflare/fix-wrong-account-reply

avoid destructuring status loader value
pull/213/head
Sven Sauleau 2023-02-07 12:15:16 +00:00 zatwierdzone przez GitHub
commit f0c6126938
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
3 zmienionych plików z 35 dodań i 9 usunięć

Wyświetl plik

@ -44,7 +44,7 @@ export const statusLoader = loader$<
export default component$(() => {
useStyles$(styles)
const { status, context } = statusLoader.use().value
const loaderData = statusLoader.use().value
return (
<>
@ -57,15 +57,15 @@ export default component$(() => {
</div>
</StickyHeader>
<div class="bg-wildebeest-700 p-4">
<AccountCard status={status} />
<div class="leading-normal inner-html-content text-lg" dangerouslySetInnerHTML={status.content} />
<AccountCard status={loaderData.status} />
<div class="leading-normal inner-html-content text-lg" dangerouslySetInnerHTML={loaderData.status.content} />
<MediaGallery medias={status.media_attachments} />
<MediaGallery medias={loaderData.status.media_attachments} />
<InfoTray status={status} />
<InfoTray status={loaderData.status} />
</div>
<div>
{context.descendants.map((status) => {
{loaderData.context.descendants.map((status) => {
return <Status status={status} />
})}
</div>

Wyświetl plik

@ -13,20 +13,20 @@ import { devices } from '@playwright/test'
const config: PlaywrightTestConfig = {
testDir: './ui-e2e-tests',
/* Maximum time one test can run for. */
timeout: 30 * 1000,
timeout: 40 * 1000,
expect: {
/**
* Maximum time expect() should wait for the condition to be met.
* For example in `await expect(locator).toHaveText();`
*/
timeout: 5000,
timeout: 7000,
},
/* Run tests in files in parallel */
fullyParallel: true,
/* Fail the build on CI if you accidentally left test.only in the source code. */
forbidOnly: !!process.env.CI,
/* Retry on CI only */
retries: process.env.CI ? 2 : 0,
retries: process.env.CI ? 5 : 0,
/* Opt out of parallel tests on CI. */
workers: process.env.CI ? 1 : undefined,
/* Reporter to use. See https://playwright.dev/docs/test-reporters */

Wyświetl plik

@ -18,3 +18,29 @@ test('Navigation to and view of an individual toot', async ({ page }) => {
})
await expect(tootContentLocator).toBeVisible()
})
test('Navigation to and view of a reply toot', async ({ page }) => {
await page.goto('http://127.0.0.1:8788/explore')
await page
.locator('article')
.filter({ hasText: 'Bethany Black' })
.filter({
hasText: 'We did it! *wipes tear from eye*',
})
.locator('i.fa-globe + span')
.click()
await page
.locator('article')
.filter({ hasText: 'Zach Weinersmith' })
.filter({
hasText: 'Yes we did!',
})
.locator('i.fa-globe + span')
.click()
await expect(page.getByRole('link', { name: 'Avatar of Zach Weinersmith' })).toBeVisible()
await expect(page.getByRole('link', { name: 'Zach Weinersmith', exact: true })).toBeVisible()
await expect(page.getByText('Yes we did!')).toBeVisible()
})