test: add flowy_editor_test into github workflows

This commit is contained in:
Lucas.Xu 2022-08-14 12:39:37 +08:00
parent d6f1593a20
commit 07ab4c2680
4 changed files with 38 additions and 11 deletions

View File

@ -78,9 +78,3 @@ jobs:
run: |
flutter pub get
flutter test
- name: Run FlowyEditor tests
working-directory: frontend/app_flowy/packages/flowy_editor
run: |
flutter pub get
flutter test

37
.github/workflows/flowy_editor_test.yml vendored Normal file
View File

@ -0,0 +1,37 @@
name: FlowyEditor test
on:
push:
branches:
- "main"
pull_request:
branches:
- "main"
- "feat/flowy_editor"
env:
CARGO_TERM_COLOR: always
jobs:
tests:
strategy:
matrix:
os: [macos-latest, ubuntu-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- uses: subosito/flutter-action@v2
with:
channel: 'stable'
flutter-version: '3.0.5'
cache: true
- name: Run FlowyEditor tests
working-directory: frontend/app_flowy/packages/flowy_editor
run: |
flutter pub get
flutter test

View File

@ -86,7 +86,7 @@ FlowyKeyEventHandler enterWithoutShiftInTextNodesHandler =
);
TransactionBuilder(editorState)
..insertNode(
textNode.path.next,
textNode.path,
TextNode.empty(),
)
..afterSelection = afterSelection

View File

@ -71,10 +71,6 @@ void main() async {
expect(lastNode != null, true);
expect(lastNode is TextNode, true);
lastNode = lastNode as TextNode;
for (final node in editor.root.children) {
print(
'path = ${node.path}, text = ${(node as TextNode).toRawString()}');
}
expect(lastNode.delta.toRawString(), text);
expect((lastNode.previous as TextNode).delta.toRawString(), '');
expect(