-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathunauthorized.test.ts
More file actions
28 lines (24 loc) · 1.11 KB
/
unauthorized.test.ts
File metadata and controls
28 lines (24 loc) · 1.11 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import { createMocks } from './mocks'
import { runBackground } from './steps/run-background'
import { mountPopup } from './steps/mount-popup'
import { authenticateViaTwitter } from './steps/authenticate-via-twitter'
import { signInViaTwitter } from './steps/sign-in-via-twitter'
import { captureFirstScreenshot } from './steps/capture-first-screenshot'
import { postingFeedback } from './steps/posting-feedback'
import { feedbackEditing } from './steps/feedback-editing'
unauthorized({ mountEarly: true })
unauthorized({ mountEarly: false })
function unauthorized({ mountEarly }: { mountEarly: boolean }): void {
let description = 'unauthorized' // tslint:disable-line:no-let
if (mountEarly) description += ' (mount early)'
describe(description, () => {
const mocks = createMocks()
runBackground(mocks, { allowActionFailure: true })
mountPopup(mocks, { handle: 'fetched' })
signInViaTwitter(mocks)
authenticateViaTwitter(mocks, { mountEarly })
captureFirstScreenshot(mocks)
feedbackEditing(mocks, { handle: '@zing' })
postingFeedback(mocks, { handle: '@zing', result: 'unauthorized' })
})
}