-
-
Notifications
You must be signed in to change notification settings - Fork 4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: icon picker issues on mobile (#7114)
* fix: icon picker issues on mobile (#7113) * fix: error displaying in Page style * fix: error displaying in Favorite/Recent page * fix: complete the filter logic of icon picker * fix: the color picker showed when tapping down * fix: icons are not supported in subpage blocks * chore: add some tests * fix: recent icons not working for grid header icon * fix: recent icon doesn't work in space icon (#7133) --------- Co-authored-by: Lucas.Xu <[email protected]>
- Loading branch information
Showing
20 changed files
with
344 additions
and
96 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
62 changes: 62 additions & 0 deletions
62
frontend/appflowy_flutter/integration_test/desktop/cloud/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,62 @@ | ||
import 'dart:convert'; | ||
|
||
import 'package:appflowy/env/cloud_env.dart'; | ||
import 'package:appflowy/shared/icon_emoji_picker/flowy_icon_emoji_picker.dart'; | ||
import 'package:appflowy/shared/icon_emoji_picker/icon_picker.dart'; | ||
import 'package:appflowy/shared/icon_emoji_picker/recent_icons.dart'; | ||
import 'package:appflowy/workspace/presentation/home/menu/sidebar/space/sidebar_space_header.dart'; | ||
import 'package:appflowy/workspace/presentation/home/menu/sidebar/space/space_action_type.dart'; | ||
import 'package:appflowy/workspace/presentation/home/menu/sidebar/space/space_more_popup.dart'; | ||
import 'package:flowy_svg/flowy_svg.dart'; | ||
import 'package:flutter_test/flutter_test.dart'; | ||
import 'package:integration_test/integration_test.dart'; | ||
|
||
import '../../../shared/emoji.dart'; | ||
import '../../../shared/util.dart'; | ||
|
||
void main() { | ||
setUpAll(() { | ||
IntegrationTestWidgetsFlutterBinding.ensureInitialized(); | ||
RecentIcons.enable = false; | ||
}); | ||
|
||
tearDownAll(() { | ||
RecentIcons.enable = true; | ||
}); | ||
|
||
testWidgets('Change slide bar space icon', (tester) async { | ||
await tester.initializeAppFlowy( | ||
cloudType: AuthenticatorType.appflowyCloudSelfHost, | ||
); | ||
await tester.tapGoogleLoginInButton(); | ||
await tester.expectToSeeHomePageWithGetStartedPage(); | ||
final emojiIconData = await tester.loadIcon(); | ||
final firstIcon = IconsData.fromJson(jsonDecode(emojiIconData.emoji)); | ||
|
||
await tester.hoverOnWidget( | ||
find.byType(SidebarSpaceHeader), | ||
onHover: () async { | ||
final moreOption = find.byType(SpaceMorePopup); | ||
await tester.tapButton(moreOption); | ||
expect(find.byType(FlowyIconEmojiPicker), findsNothing); | ||
await tester.tapSvgButton(SpaceMoreActionType.changeIcon.leftIconSvg); | ||
expect(find.byType(FlowyIconEmojiPicker), findsOneWidget); | ||
}, | ||
); | ||
|
||
final icons = find.byWidgetPredicate( | ||
(w) => w is FlowySvg && w.svgString == firstIcon.iconContent, | ||
); | ||
expect(icons, findsOneWidget); | ||
await tester.tapIcon(EmojiIconData.icon(firstIcon)); | ||
|
||
final spaceHeader = find.byType(SidebarSpaceHeader); | ||
final spaceIcon = find.descendant( | ||
of: spaceHeader, | ||
matching: find.byWidgetPredicate( | ||
(w) => w is FlowySvg && w.svgString == firstIcon.iconContent, | ||
), | ||
); | ||
expect(spaceIcon, findsOneWidget); | ||
}); | ||
} |
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
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
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.