Skip to content

Commit

Permalink
fix: uncomment tests
Browse files Browse the repository at this point in the history
  • Loading branch information
tiensonqin committed Apr 5, 2022
1 parent 5a0a199 commit 4bf2af5
Showing 1 changed file with 54 additions and 54 deletions.
108 changes: 54 additions & 54 deletions e2e-tests/editor.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,66 +4,66 @@ import { createRandomPage, enterNextBlock, editFirstBlock, IsMac } from './utils
import { dispatch_kb_events } from './util/keyboard-events'
import * as kb_events from './util/keyboard-events'

// test(
// "press Chinese parenthesis 【 by 2 times #3251 should trigger [[]], " +
// "but dont trigger RIME #3440 ",
// // cases should trigger [[]] #3251
// async ({ page }) => {
// for (let [idx, events] of [
// kb_events.win10_pinyin_left_full_square_bracket,
// kb_events.macos_pinyin_left_full_square_bracket
// // TODO: support #3741
// // kb_events.win10_legacy_pinyin_left_full_square_bracket,
// ].entries()) {
// await createRandomPage(page)
// let check_text = "#3251 test " + idx
// await page.fill(':nth-match(textarea, 1)', check_text + "【")
// await dispatch_kb_events(page, ':nth-match(textarea, 1)', events)
// expect(await page.inputValue(':nth-match(textarea, 1)')).toBe(check_text + '【')
// await page.fill(':nth-match(textarea, 1)', check_text + "【【")
// await dispatch_kb_events(page, ':nth-match(textarea, 1)', events)
// expect(await page.inputValue(':nth-match(textarea, 1)')).toBe(check_text + '[[]]')
// };

// // dont trigger RIME #3440
// for (let [idx, events] of [
// kb_events.macos_pinyin_selecting_candidate_double_left_square_bracket,
// kb_events.win10_RIME_selecting_candidate_double_left_square_bracket
// ].entries()) {
// await createRandomPage(page)
// let check_text = "#3440 test " + idx
// await page.fill(':nth-match(textarea, 1)', check_text)
// await dispatch_kb_events(page, ':nth-match(textarea, 1)', events)
// expect(await page.inputValue(':nth-match(textarea, 1)')).toBe(check_text)
// await dispatch_kb_events(page, ':nth-match(textarea, 1)', events)
// expect(await page.inputValue(':nth-match(textarea, 1)')).toBe(check_text)
// }
// })

// test('hashtag and quare brackets in same line #4178', async ({ page }) => {
// await createRandomPage(page)
test(
"press Chinese parenthesis 【 by 2 times #3251 should trigger [[]], " +
"but dont trigger RIME #3440 ",
// cases should trigger [[]] #3251
async ({ page }) => {
for (let [idx, events] of [
kb_events.win10_pinyin_left_full_square_bracket,
kb_events.macos_pinyin_left_full_square_bracket
// TODO: support #3741
// kb_events.win10_legacy_pinyin_left_full_square_bracket,
].entries()) {
await createRandomPage(page)
let check_text = "#3251 test " + idx
await page.fill(':nth-match(textarea, 1)', check_text + "【")
await dispatch_kb_events(page, ':nth-match(textarea, 1)', events)
expect(await page.inputValue(':nth-match(textarea, 1)')).toBe(check_text + '【')
await page.fill(':nth-match(textarea, 1)', check_text + "【【")
await dispatch_kb_events(page, ':nth-match(textarea, 1)', events)
expect(await page.inputValue(':nth-match(textarea, 1)')).toBe(check_text + '[[]]')
};

// dont trigger RIME #3440
for (let [idx, events] of [
kb_events.macos_pinyin_selecting_candidate_double_left_square_bracket,
kb_events.win10_RIME_selecting_candidate_double_left_square_bracket
].entries()) {
await createRandomPage(page)
let check_text = "#3440 test " + idx
await page.fill(':nth-match(textarea, 1)', check_text)
await dispatch_kb_events(page, ':nth-match(textarea, 1)', events)
expect(await page.inputValue(':nth-match(textarea, 1)')).toBe(check_text)
await dispatch_kb_events(page, ':nth-match(textarea, 1)', events)
expect(await page.inputValue(':nth-match(textarea, 1)')).toBe(check_text)
}
})

test('hashtag and quare brackets in same line #4178', async ({ page }) => {
await createRandomPage(page)

// await page.type('textarea >> nth=0', '#foo bar')
// await enterNextBlock(page)
// await page.type('textarea >> nth=0', 'bar [[blah]]', { delay: 100})
await page.type('textarea >> nth=0', '#foo bar')
await enterNextBlock(page)
await page.type('textarea >> nth=0', 'bar [[blah]]', { delay: 100})

// for (let i = 0; i < 12; i++) {
// await page.press('textarea >> nth=0', 'ArrowLeft')
// }
// await page.type('textarea >> nth=0', ' ')
// await page.press('textarea >> nth=0', 'ArrowLeft')
for (let i = 0; i < 12; i++) {
await page.press('textarea >> nth=0', 'ArrowLeft')
}
await page.type('textarea >> nth=0', ' ')
await page.press('textarea >> nth=0', 'ArrowLeft')

// await page.type('textarea >> nth=0', '#')
// await page.waitForSelector('text="Search for a page"', { state: 'visible' })
await page.type('textarea >> nth=0', '#')
await page.waitForSelector('text="Search for a page"', { state: 'visible' })

// await page.type('textarea >> nth=0', 'fo')
await page.type('textarea >> nth=0', 'fo')

// await page.click('.absolute >> text=' + 'foo')
await page.click('.absolute >> text=' + 'foo')

// expect(await page.inputValue('textarea >> nth=0')).toBe(
// '#foo bar [[blah]]'
// )
// })
expect(await page.inputValue('textarea >> nth=0')).toBe(
'#foo bar [[blah]]'
)
})

test('disappeared children #4814', async ({ page }) => {
await createRandomPage(page)
Expand Down

0 comments on commit 4bf2af5

Please sign in to comment.