forked from AppFlowy-IO/AppFlowy
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: display the titles of a view's ancestors and the view's title o…
…n the title bar. (AppFlowy-IO#3898) * feat: add no pages inside tips * feat: show view's ancestors (include itself) title on bar * feat: show view's ancestors (include itself) title on bar * test: add integration tests * fix: integration tests
- Loading branch information
Showing
15 changed files
with
507 additions
and
70 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
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
76 changes: 76 additions & 0 deletions
76
frontend/appflowy_flutter/integration_test/sidebar/sidebar_icon_test.dart
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,76 @@ | ||
import 'package:appflowy_backend/protobuf/flowy-folder2/view.pb.dart'; | ||
import 'package:flutter_test/flutter_test.dart'; | ||
import 'package:integration_test/integration_test.dart'; | ||
|
||
import '../util/base.dart'; | ||
import '../util/common_operations.dart'; | ||
import '../util/expectation.dart'; | ||
|
||
void main() { | ||
IntegrationTestWidgetsFlutterBinding.ensureInitialized(); | ||
|
||
const emoji = '😁'; | ||
|
||
group('Icon', () { | ||
testWidgets('Update page icon in sidebar', (tester) async { | ||
await tester.initializeAppFlowy(); | ||
await tester.tapGoButton(); | ||
|
||
// create document, board, grid and calendar views | ||
for (final value in ViewLayoutPB.values) { | ||
await tester.createNewPageWithName( | ||
name: value.name, | ||
parentName: gettingStarted, | ||
layout: value, | ||
); | ||
|
||
// update its icon | ||
await tester.updatePageIconInSidebarByName( | ||
name: value.name, | ||
parentName: gettingStarted, | ||
layout: value, | ||
icon: emoji, | ||
); | ||
|
||
tester.expectViewHasIcon( | ||
value.name, | ||
value, | ||
emoji, | ||
); | ||
} | ||
}); | ||
|
||
testWidgets('Update page icon in title bar', (tester) async { | ||
await tester.initializeAppFlowy(); | ||
await tester.tapGoButton(); | ||
|
||
// create document, board, grid and calendar views | ||
for (final value in ViewLayoutPB.values) { | ||
await tester.createNewPageWithName( | ||
name: value.name, | ||
parentName: gettingStarted, | ||
layout: value, | ||
); | ||
|
||
// update its icon | ||
await tester.updatePageIconInTitleBarByName( | ||
name: value.name, | ||
layout: value, | ||
icon: emoji, | ||
); | ||
|
||
tester.expectViewHasIcon( | ||
value.name, | ||
value, | ||
emoji, | ||
); | ||
|
||
tester.expectViewTitleHasIcon( | ||
value.name, | ||
value, | ||
emoji, | ||
); | ||
} | ||
}); | ||
}); | ||
} |
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
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
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 |
---|---|---|
@@ -1,10 +1,14 @@ | ||
import 'package:emoji_mart/emoji_mart.dart'; | ||
import 'package:flutter_test/flutter_test.dart'; | ||
|
||
import 'base.dart'; | ||
|
||
extension EmojiTestExtension on WidgetTester { | ||
Future<void> tapEmoji(String emoji) async { | ||
final emojiWidget = find.text(emoji); | ||
final emojiWidget = find.descendant( | ||
of: find.byType(EmojiPicker), | ||
matching: find.text(emoji), | ||
); | ||
await tapButton(emojiWidget); | ||
} | ||
} |
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
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
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
Oops, something went wrong.