13.19f: review 3's scope; the tab strip's other-tab guard and the divider's second press pinned

This commit is contained in:
ZacharyZhang-NY committed 2026-10-03 20:46:39 -04:00
1 parent 1de10e711c
commit 28f6337d13
4 files changed
+37 -5

No files matched your search

+25
View File
@@ -71,6 +71,7 @@ private slots:
void aBusyProjectHoldsTheOrder();
void aTabClosedMidDragEndsIt();
void aLostReleaseGivesWayToTheNextDrag();
void anotherTabPressedBeforeTheWatchMovesNothing();
void tabsThatDoNotFitGatherInAMenu();
void theMenuSwitchesAndPinsTheChosenTab();
void aBusyProjectOpensNoMenu();
@@ -238,6 +239,30 @@ void ProjectTabDragTests::aLostReleaseGivesWayToTheNextDrag()
QCOMPARE(titles(fixture.workspace), (QStringList{"Untitled 3", "Untitled", "Untitled 2"}));
}
void ProjectTabDragTests::anotherTabPressedBeforeTheWatchMovesNothing()
{
Strip fixture;
const QPoint first = fixture.press("Untitled");
fixture.move(first + QPoint(5000, 0));
const int held = button(fixture.strip, "Untitled").x();
QVERIFY(held > 100);
QDialog alert;
alert.setModal(true);
alert.show();
QVERIFY(QTest::qWaitForWindowExposed(&alert));
fixture.release("Untitled", first + QPoint(5000, 0));
alert.close();
// Pressed before the watch looks: the first drag holds.
const QPoint next = fixture.press("Untitled 2");
fixture.move(next - QPoint(5000, 0));
QCOMPARE(button(fixture.strip, "Untitled").x(), held);
// Its release ends the first drag, which moved nothing.
fixture.release("Untitled 2", next - QPoint(5000, 0));
QTRY_VERIFY(settled(fixture.strip));
QCOMPARE(button(fixture.strip, "Untitled").x(), 0);
QCOMPARE(titles(fixture.workspace), (QStringList{"Untitled", "Untitled 2", "Untitled 3"}));
}
void ProjectTabDragTests::tabsThatDoNotFitGatherInAMenu()
{
Strip fixture(12, 400);