Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit caaa6489 authored by lyn's avatar lyn
Browse files

Test grouping two notifs inside bundle

Bug: 389839319
Test: this
Flag: TEST_ONLY
Change-Id: I5ace07a1f6a0fa01fb0f263e668879782794b8a9
parent aceb1ed5
Loading
Loading
Loading
Loading
+35 −0
Original line number Diff line number Diff line
@@ -317,6 +317,41 @@ public class ShadeListBuilderTest extends SysuiTestCase {
        );
    }

    @Test
    @EnableFlags(NotificationBundleUi.FLAG_NAME)
    public void testBundle_combineTwoNotifs_intoOneGroup() {
        mListBuilder.setBundler(TestBundler.INSTANCE);

        // GIVEN single notif that will be bundled
        addGroupChild(0, PACKAGE_1, GROUP_1, BUNDLE_1);
        dispatchBuild();

        // VERIFY single notif shows in bundle
        verifyBuiltList(
                bundle(
                        BUNDLE_1,
                        notif(0) // Child is promoted out of group inside bundle
                )
        );

        // Add summary and child in same group
        addGroupSummary(1, PACKAGE_1, GROUP_1, BUNDLE_1);
        addGroupChild(2, PACKAGE_1, GROUP_1, BUNDLE_1);
        dispatchBuild();

        // Verify new additions are grouped inside bundle
        verifyBuiltList(
                bundle(
                        BUNDLE_1,
                        group(
                            summary(1),
                            child(0),
                            child(2)
                        )
                )
        );
    }

    @Test
    @EnableFlags(NotificationBundleUi.FLAG_NAME)
    public void testBundleGroupChildrenAreSorted() {