forked from ianstormtaylor/slate
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Convert Slate tests to TypeScript (ianstormtaylor#3784)
* changed to tsx * slate tests * finished making typescript tests * linting * linting * reverted slate-hyperscript files to jsx and changed edlint config * removed extra file * Update package.json * Update package.json * deleted { file * changed to tsx * slate tests * finished making typescript tests * linting * linting * reverted slate-hyperscript files to jsx and changed edlint config * removed extra file * Update package.json * Update package.json * deleted { file * rebase * removed ~ files * changed yarn
- Loading branch information
Showing
1,700 changed files
with
17,484 additions
and
20,671 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 0 additions & 27 deletions
27
packages/slate-history/test/undo/delete_backward/block-join-reverse.js
This file was deleted.
Oops, something went wrong.
24 changes: 24 additions & 0 deletions
24
packages/slate-history/test/undo/delete_backward/block-join-reverse.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
/** @jsx jsx */ | ||
import { jsx } from '../..' | ||
|
||
export const run = editor => { | ||
editor.deleteBackward() | ||
} | ||
export const input = ( | ||
<editor> | ||
<block>Hello</block> | ||
<block> | ||
<cursor /> | ||
world! | ||
</block> | ||
</editor> | ||
) | ||
export const output = ( | ||
<editor> | ||
<block>Hello</block> | ||
<block> | ||
<cursor /> | ||
world! | ||
</block> | ||
</editor> | ||
) |
31 changes: 0 additions & 31 deletions
31
packages/slate-history/test/undo/delete_backward/block-nested-reverse.js
This file was deleted.
Oops, something went wrong.
28 changes: 28 additions & 0 deletions
28
packages/slate-history/test/undo/delete_backward/block-nested-reverse.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
/** @jsx jsx */ | ||
import { jsx } from '../..' | ||
|
||
export const run = editor => { | ||
editor.deleteBackward() | ||
} | ||
export const input = ( | ||
<editor> | ||
<block>Hello</block> | ||
<block> | ||
<block> | ||
<cursor /> | ||
world! | ||
</block> | ||
</block> | ||
</editor> | ||
) | ||
export const output = ( | ||
<editor> | ||
<block>Hello</block> | ||
<block> | ||
<block> | ||
<cursor /> | ||
world! | ||
</block> | ||
</block> | ||
</editor> | ||
) |
20 changes: 0 additions & 20 deletions
20
packages/slate-history/test/undo/delete_backward/block-text.js
This file was deleted.
Oops, something went wrong.
17 changes: 17 additions & 0 deletions
17
packages/slate-history/test/undo/delete_backward/block-text.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
/** @jsx jsx */ | ||
import { Transforms } from 'slate' | ||
import { jsx } from '../..' | ||
|
||
export const run = editor => { | ||
Transforms.delete(editor) | ||
} | ||
export const input = ( | ||
<editor> | ||
<block> | ||
wo | ||
<cursor /> | ||
rd | ||
</block> | ||
</editor> | ||
) | ||
export const output = input |
23 changes: 0 additions & 23 deletions
23
packages/slate-history/test/undo/delete_backward/custom-prop.js
This file was deleted.
Oops, something went wrong.
20 changes: 20 additions & 0 deletions
20
packages/slate-history/test/undo/delete_backward/custom-prop.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
/** @jsx jsx */ | ||
import { Transforms } from 'slate' | ||
import { jsx } from '../..' | ||
|
||
export const run = editor => { | ||
Transforms.delete(editor) | ||
} | ||
export const input = ( | ||
<editor> | ||
<block a> | ||
o<anchor /> | ||
ne | ||
</block> | ||
<block b> | ||
tw | ||
<focus />o | ||
</block> | ||
</editor> | ||
) | ||
export const output = input |
31 changes: 0 additions & 31 deletions
31
packages/slate-history/test/undo/delete_backward/inline-across.js
This file was deleted.
Oops, something went wrong.
28 changes: 28 additions & 0 deletions
28
packages/slate-history/test/undo/delete_backward/inline-across.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
/** @jsx jsx */ | ||
import { Transforms } from 'slate' | ||
import { jsx } from '../..' | ||
|
||
export const run = editor => { | ||
Transforms.delete(editor) | ||
} | ||
export const input = ( | ||
<editor> | ||
<block> | ||
<text /> | ||
<inline a> | ||
o<anchor /> | ||
ne | ||
</inline> | ||
<text /> | ||
</block> | ||
<block> | ||
<text /> | ||
<inline b> | ||
tw | ||
<focus />o | ||
</inline> | ||
<text /> | ||
</block> | ||
</editor> | ||
) | ||
export const output = input |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
/** @jsx jsx */ | ||
import { Editor } from 'slate' | ||
import { jsx } from '../..' | ||
|
||
export const run = editor => { | ||
editor.insertBreak() | ||
} | ||
export const input = ( | ||
<editor> | ||
<block> | ||
<block> | ||
on | ||
<cursor />e | ||
</block> | ||
<block>two</block> | ||
</block> | ||
</editor> | ||
) | ||
export const output = input |
This file was deleted.
Oops, something went wrong.
37 changes: 37 additions & 0 deletions
37
packages/slate-history/test/undo/insert_fragment/basic.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
/** @jsx jsx */ | ||
import { jsx } from '../..' | ||
|
||
const fragment = ( | ||
<block type="d"> | ||
<block>A</block> | ||
<block type="c"> | ||
<block type="d"> | ||
<block>B</block> | ||
<block> | ||
<block type="d"> | ||
<block>C</block> | ||
</block> | ||
</block> | ||
</block> | ||
<block type="d"> | ||
<block>D</block> | ||
</block> | ||
</block> | ||
</block> | ||
) | ||
export const run = editor => { | ||
editor.insertFragment(fragment) | ||
} | ||
export const input = ( | ||
<editor> | ||
<block type="d"> | ||
<block> | ||
<text> | ||
<cursor /> | ||
</text> | ||
</block> | ||
</block> | ||
</editor> | ||
) | ||
export const output = input | ||
export const skip = true |
Oops, something went wrong.