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

Commit 8526449a authored by lyn's avatar lyn
Browse files

Test that bundle group child is not promoted

Bug: 389839319
Test: this
Flag: TEST_ONLY
Change-Id: I95f1680dc01bf1c1b41ccd7b36cc1512971ee7ee
parent 562939fd
Loading
Loading
Loading
Loading
+32 −0
Original line number Diff line number Diff line
@@ -988,6 +988,38 @@ public class ShadeListBuilderTest extends SysuiTestCase {
        verify(idPromoter, never()).shouldPromoteToTopLevel(eq(promotableEntry));
    }

    @Test
    @EnableFlags(NotificationBundleUi.FLAG_NAME)
    public void testBundle_groupNotifNotPromoted() {
        final int promotableId = 123;

        IdPromoter idPromoter = spy(new IdPromoter(promotableId));
        mListBuilder.addPromoter(idPromoter);
        mListBuilder.setBundler(TestBundler.INSTANCE);

        // Add promotable child in a group that will be bundled
        addGroupSummary(0, PACKAGE_1, GROUP_1, BUNDLE_1);
        addGroupChild(1, PACKAGE_1, GROUP_1, BUNDLE_1).setId(promotableId);
        addGroupChild(2, PACKAGE_1, GROUP_1, BUNDLE_1);

        dispatchBuild();

        // Verify that group child was not promoted out of bundle
        verifyBuiltList(
                bundle(
                        BUNDLE_1,
                        group(
                                summary(0),
                                child(1),
                                child(2)
                        )
                )
        );

        NotificationEntry promotableChild = mEntrySet.get(1);
        verify(idPromoter, never()).shouldPromoteToTopLevel(eq(promotableChild));
    }

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