Merge branch 'master' into feat/db

This commit is contained in:
Konstantinos Kaloutas
2024-01-19 17:00:52 +02:00
158 changed files with 24102 additions and 1655 deletions

View File

@@ -79,33 +79,79 @@ test('delete and backspace', async ({ page, block }) => {
})
test('selection', async ({ page, block }) => {
test('block selection', async ({ page, block }) => {
await createRandomPage(page)
// add 5 blocks
await block.mustFill('line 1')
await block.mustFill('1')
await block.enterNext()
await block.mustFill('line 2')
await block.enterNext()
expect(await block.indent()).toBe(true)
await block.mustFill('line 3')
await block.enterNext()
await block.mustFill('line 4')
await block.mustFill('2')
expect(await block.indent()).toBe(true)
await block.enterNext()
await block.mustFill('line 5')
await block.mustFill('3')
await block.enterNext()
await block.mustFill('4')
expect(await block.unindent()).toBe(true)
await block.enterNext()
await block.mustFill('5')
expect(await block.indent()).toBe(true)
await block.enterNext()
await block.mustFill('6')
await block.enterNext()
await block.mustFill('7')
expect(await block.unindent()).toBe(true)
await block.enterNext()
await block.mustFill('8')
expect(await block.indent()).toBe(true)
await block.enterNext()
await block.mustFill('9')
expect(await block.unindent()).toBe(true)
// shift+up select 3 blocks
// shift+up/down
await page.keyboard.down('Shift')
await page.keyboard.press('ArrowUp', { delay: 20 })
await page.keyboard.press('ArrowUp', { delay: 20 })
await page.keyboard.press('ArrowUp', { delay: 20 })
await page.keyboard.press('ArrowUp')
await block.waitForSelectedBlocks(1)
let locator = page.locator('.ls-block >> nth=8')
await page.keyboard.press('ArrowUp')
await block.waitForSelectedBlocks(2)
await page.keyboard.press('ArrowUp')
await block.waitForSelectedBlocks(3)
await page.keyboard.press('ArrowDown')
await block.waitForSelectedBlocks(2)
await page.keyboard.up('Shift')
await block.waitForSelectedBlocks(3)
await page.keyboard.press('Backspace')
// mod+click select or deselect
await page.keyboard.down(modKey)
await page.click('.ls-block >> nth=7')
await block.waitForSelectedBlocks(1)
await block.waitForBlocks(2)
await page.click('.block-main-container >> nth=6')
await block.waitForSelectedBlocks(2)
// mod+shift+click
await page.click('.ls-block >> nth=4')
await block.waitForSelectedBlocks(3)
await page.keyboard.down('Shift')
await page.click('.ls-block >> nth=1')
await block.waitForSelectedBlocks(6)
await page.keyboard.up('Shift')
await page.keyboard.up(modKey)
await page.keyboard.press('Escape')
// shift+click
await page.keyboard.down('Shift')
await page.click('.block-main-container >> nth=0')
await page.click('.block-main-container >> nth=3')
await block.waitForSelectedBlocks(4)
await page.click('.ls-block >> nth=8')
await block.waitForSelectedBlocks(9)
await page.click('.ls-block >> nth=5')
await block.waitForSelectedBlocks(6)
await page.keyboard.up('Shift')
})
test('template', async ({ page, block }) => {
@@ -114,7 +160,7 @@ test('template', async ({ page, block }) => {
await createRandomPage(page)
await block.mustFill('template test\ntemplate:: ')
await page.keyboard.type(randomTemplate, {delay: 100})
await page.keyboard.type(randomTemplate, { delay: 100 })
await page.keyboard.press('Enter')
await page.keyboard.press('Escape')
await block.clickNext()
@@ -237,7 +283,7 @@ test('invalid page props #3944', async ({ page, block }) => {
await block.enterNext()
})
test('Scheduled date picker should point to the already specified Date #6985', async({page,block})=>{
test('Scheduled date picker should point to the already specified Date #6985', async ({ page, block }) => {
await createRandomPage(page)
await block.mustFill('testTask \n SCHEDULED: <2000-05-06 Sat>')
@@ -248,15 +294,15 @@ test('Scheduled date picker should point to the already specified Date #6985', a
// Open date picker
await page.click('a.opacity-80')
await page.waitForTimeout(500)
expect(page.locator('text=May 2000')).toBeVisible()
expect(page.locator('td:has-text("6").active')).toBeVisible()
await expect(page.locator('text=May 2000')).toBeVisible()
await expect(page.locator('td:has-text("6").active')).toBeVisible()
// Close date picker
await page.click('a.opacity-80')
await page.waitForTimeout(500)
})
test('Opening a second datepicker should close the first one #7341', async({page,block})=>{
test('Opening a second datepicker should close the first one #7341', async ({ page, block }) => {
await createRandomPage(page)
await block.mustFill('testTask \n SCHEDULED: <2000-05-06 Sat>')
@@ -274,10 +320,10 @@ test('Opening a second datepicker should close the first one #7341', async({page
await page.waitForTimeout(50)
await page.click('a:has-text("2000-05-06 Sat").opacity-80')
await page.waitForTimeout(50)
expect(page.locator('text=May 2000')).toBeVisible()
expect(page.locator('td:has-text("6").active')).toBeVisible()
expect(page.locator('text=June 2000')).not.toBeVisible()
expect(page.locator('td:has-text("7").active')).not.toBeVisible()
await expect(page.locator('text=May 2000')).toBeVisible()
await expect(page.locator('td:has-text("6").active')).toBeVisible()
await expect(page.locator('text=June 2000')).not.toBeVisible()
await expect(page.locator('td:has-text("7").active')).not.toBeVisible()
// Close date picker
await page.click('a:has-text("2000-05-06 Sat").opacity-80')