File tree Expand file tree Collapse file tree 2 files changed +28
-21
lines changed Expand file tree Collapse file tree 2 files changed +28
-21
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change
1
+ import { expect , test } from '@playwright/test'
2
+ import moment from 'moment'
3
+
4
+ test . describe ( 'nodepad' , ( ) => {
5
+ test . beforeEach ( async ( { page } ) => {
6
+ await page . goto ( '/notepad' )
7
+ await page . waitForSelector ( '[data-is-mounted="true"]' )
8
+ await page . waitForTimeout ( 1000 )
9
+ } )
10
+
11
+ test ( 'is focused' , async ( { page } ) => {
12
+ const classes = await page . evaluate ( ( ) => {
13
+ return Array . from ( document . activeElement ?. classList || [ ] )
14
+ } )
15
+
16
+ expect ( classes ) . toContain ( 'ink-mde-editor-content' )
17
+ } )
18
+
19
+ test ( 'has some default text' , async ( { page } ) => {
20
+ const date = moment ( ) . format ( 'dddd, MMMM Do, YYYY' )
21
+
22
+ const doc = await page . evaluate ( ( ) => {
23
+ return window . inkMde . getDoc ( )
24
+ } )
25
+
26
+ expect ( doc ) . toMatch ( new RegExp ( `^#daily\n\n# ${ date } \n\n` ) )
27
+ } )
28
+ } )
You can’t perform that action at this time.
0 commit comments