Refine board notes, clipping evidence, and case reports
This commit is contained in:
@@ -2,11 +2,20 @@ import { expect, test } from '@playwright/test'
|
||||
|
||||
test('pasting, connecting, and citing one patent screenshot completes the Scene 7 report lesson', async ({ page, request }) => {
|
||||
test.setTimeout(60_000)
|
||||
const levels = await (await request.get('/api/levels')).json() as { id:string }[]
|
||||
const sceneSeven = levels.find(level => level.id.startsWith('barricelli-inventor-proof-case-'))
|
||||
const pageErrors:Error[]=[]
|
||||
page.on('pageerror',error => pageErrors.push(error))
|
||||
let sceneSeven:{ id:string } | undefined
|
||||
await expect.poll(async () => {
|
||||
const levels=await (await request.get('/api/levels')).json() as { id:string }[]
|
||||
sceneSeven=levels.find(level => level.id.startsWith('barricelli-inventor-proof-case-'))
|
||||
return Boolean(sceneSeven)
|
||||
},{ timeout:20_000,message:'Scene 7 playable clone should be seeded' }).toBe(true)
|
||||
if (!sceneSeven) throw new Error('Scene 7 playable clone was not seeded')
|
||||
const sceneSevenId=sceneSeven.id
|
||||
|
||||
await page.goto(`/level/${sceneSeven.id}`)
|
||||
await page.goto(`/level/${sceneSevenId}`)
|
||||
await page.waitForTimeout(250)
|
||||
if (pageErrors.length) throw new Error(`Scene 7 failed to render: ${pageErrors.map(error => error.message).join('; ')}`)
|
||||
await expect(page.getByRole('heading', { name:'The Barricelli Files' })).toBeVisible()
|
||||
await expect(page.locator('.brief-panel')).toBeVisible()
|
||||
await expect(page.locator('.brief-goals')).toContainText('Prove Nils Aall Barricelli was an inventor')
|
||||
@@ -14,7 +23,7 @@ test('pasting, connecting, and citing one patent screenshot completes the Scene
|
||||
await page.getByRole('button', { name:'BEGIN INVESTIGATION',exact:true }).click()
|
||||
|
||||
const uploadResponse = page.waitForResponse(response => response.request().method() === 'POST'
|
||||
&& response.url().includes(`/api/levels/${sceneSeven.id}/documents`) && response.status() === 201)
|
||||
&& response.url().includes(`/api/levels/${sceneSevenId}/documents`) && response.status() === 201)
|
||||
await page.evaluate(async () => {
|
||||
const canvas = document.createElement('canvas')
|
||||
canvas.width = 1280
|
||||
@@ -46,6 +55,7 @@ test('pasting, connecting, and citing one patent screenshot completes the Scene
|
||||
await page.getByRole('button',{ name:'Classify as Clip' }).click()
|
||||
await expect(page.locator('.source-file-widget')).toHaveCount(1)
|
||||
await expect(page.locator('.source-file-widget')).toHaveAttribute('data-capture-kind','clipping')
|
||||
await expect(page.locator('.source-file-widget > strong')).toHaveCount(0)
|
||||
await expect(page.locator('.source-file-widget')).toHaveClass(/\barriving\b/)
|
||||
await expect(page.locator('.goal-complete-card')).toHaveCount(0)
|
||||
await expect(page.locator('.evidence-card.claim')).toContainText('Nils Aall Barricelli was an inventor')
|
||||
@@ -60,35 +70,47 @@ test('pasting, connecting, and citing one patent screenshot completes the Scene
|
||||
await page.getByRole('button',{ name:'FILE',exact:true }).click()
|
||||
await page.getByRole('menuitem',{ name:/INFO/ }).click()
|
||||
await expect(page.getByLabel('Board presentation')).toHaveValue('clipping')
|
||||
await expect(page.getByLabel('Document title')).toHaveValue('')
|
||||
await page.getByLabel('Published date').fill('1953-08-19')
|
||||
await expect(page.getByLabel('Published time')).toHaveValue('')
|
||||
await page.getByLabel('Source publication').fill('Google Patents · GB695913A')
|
||||
await page.getByLabel('Source URL').fill('https://patents.google.com/patent/GB695913A/en')
|
||||
await page.getByRole('button',{ name:'SAVE METADATA' }).click()
|
||||
await expect(page.locator('.file-editor')).toHaveCount(0)
|
||||
await page.getByRole('button',{ name:'FILE',exact:true }).click()
|
||||
await page.getByRole('menuitem',{ name:/INFO/ }).click()
|
||||
await expect(page.getByLabel('Document title')).toHaveValue('Google Patents · GB695913A')
|
||||
await expect(page.getByLabel('Source publication')).toHaveValue('Google Patents · GB695913A')
|
||||
await page.getByRole('button',{ name:'Close file editor' }).click()
|
||||
await page.getByRole('button',{ name:'Close document' }).click()
|
||||
await page.getByRole('button',{ name:'Close document',exact:true }).click()
|
||||
|
||||
await page.locator('.evidence-card.claim').click()
|
||||
await page.getByRole('button',{ name:'Red thread' }).click()
|
||||
await page.locator('.source-file-widget').click()
|
||||
await expect(page.locator('.thread-editor')).toBeVisible()
|
||||
await expect(page.getByLabel('Thread tag')).toHaveValue('Proof that…')
|
||||
await page.getByLabel('Thread tag').fill('Proof that Nils Aall Barricelli is named as inventor on patent GB695913A.')
|
||||
await page.getByRole('button',{ name:'ADD TAG & TIGHTEN' }).click()
|
||||
|
||||
await page.getByRole('button',{ name:'Case report' }).click()
|
||||
await expect(page.locator('.case-report')).toBeVisible()
|
||||
await expect(page.locator('.report-claim')).toContainText('Nils Aall Barricelli was an inventor')
|
||||
await expect(page.locator('.report-evidence')).toContainText('Exhibit 1')
|
||||
await page.getByRole('button',{ name:'SUBMIT CASE REPORT' }).click()
|
||||
await expect(page.locator('.report-verdict')).toContainText("The evidence is good enough, but the report itself won't hold up in court")
|
||||
|
||||
await page.getByLabel('Evidence statement for Exhibit 1').fill('Proof that Nils Aall Barricelli is named as inventor on patent GB695913A.')
|
||||
await page.getByLabel('Date for Exhibit 1').fill('1953-08-19')
|
||||
await page.getByLabel('Source for Exhibit 1').fill('Google Patents · GB695913A')
|
||||
await page.getByLabel('Source link for Exhibit 1').fill('https://patents.google.com/patent/GB695913A/en')
|
||||
await expect(page.locator('.report-evidence')).toContainText('Proof that Nils Aall Barricelli is named as inventor on patent GB695913A.')
|
||||
await expect(page.locator('.report-evidence')).toContainText('1953-08-19')
|
||||
await expect(page.locator('.report-evidence')).toContainText('Google Patents · GB695913A')
|
||||
await expect(page.locator('.report-evidence a')).toHaveAttribute('href','https://patents.google.com/patent/GB695913A/en')
|
||||
await page.getByRole('button',{ name:'SUBMIT CASE REPORT' }).click()
|
||||
await expect(page.locator('.report-verdict')).toContainText('Case report accepted')
|
||||
await expect(page.getByRole('button',{ name:/CLOSE CASE/ })).toBeVisible()
|
||||
|
||||
const level = await (await request.get(`/api/levels/${sceneSeven.id}`)).json()
|
||||
const level = await (await request.get(`/api/levels/${sceneSevenId}`)).json()
|
||||
expect(level.goals).toEqual([expect.objectContaining({ key:'barricelli.inventor-proof',status:'complete',newlyCompleted:false })])
|
||||
expect(level.exhibits.filter((exhibit: { type:string }) => exhibit.type === 'document')).toEqual([
|
||||
expect.objectContaining({ captureKind:'clipping',width:210,height:194 }),
|
||||
const savedDocuments=level.exhibits.filter((exhibit: { type:string }) => exhibit.type === 'document')
|
||||
expect(savedDocuments).toEqual([
|
||||
expect.objectContaining({ title:'Google Patents · GB695913A',captureKind:'clipping',width:230,height:290 }),
|
||||
])
|
||||
expect(savedDocuments[0].rotation).toBeGreaterThanOrEqual(-10)
|
||||
expect(savedDocuments[0].rotation).toBeLessThanOrEqual(10)
|
||||
expect(level.report).toMatchObject({ status:'accepted',investigatorName:'Player' })
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user