on xenial help sign in
check that if no navigation is around the primary filter is shown
commitdd7410a0d8b99ea6df14731265bce5d2ca325039 authorAlbert Astals Cid <albert.astals@canonical.com> dateTue 13 Oct 2015, 15:27 (11 years ago) parent4bea1cd
2 files changed+17−1
tests/mocks/Unity/fake_scope.cpp+3−1 tests/qmltests/Dash/tst_DashContent.qml+14
tests/mocks/Unity/fake_scope.cpp+3−1
@@ -49,7 +49,7 @@ Scope::Scope(QString const& id, QString const& name, bool favorite, Scopes* pare
4949 , m_filters(new Filters(this))
5050 , m_returnNullPreview(returnNullPreview)
5151{
52− m_primaryNavigationFilter = new FakeOptionSelectorFilter("OSF2", "PFTag", "Which food you like More", false, QStringList() << "meat" << "vegetables", this);
52+ m_primaryNavigationFilter = new FakeOptionSelectorFilter("OSF3", "PFTag", "Which food you like More", false, QStringList() << "meat" << "vegetables", this);
5353}
5454
5555QString Scope::id() const
@@ -235,6 +235,7 @@ bool Scope::hasNavigation() const
235235void Scope::setHasNavigation(bool hasNavigation)
236236{
237237 m_hasNavigation = hasNavigation;
238+ Q_EMIT hasNavigationChanged();
238239}
239240
240241Scope::Status Scope::status() const
@@ -329,6 +330,7 @@ void Scope::resetPrimaryNavigationTag()
329330void Scope::setHasPrimaryFilter(bool hasPrimaryFilter)
330331{
331332 m_hasPrimaryFilter = hasPrimaryFilter;
333+ Q_EMIT primaryNavigationFilterChanged();
332334}
333335
334336void Scope::performQuery(const QString& query)
tests/qmltests/Dash/tst_DashContent.qml+14
@@ -547,6 +547,20 @@ Item {
547547 verify(filtersPopover);
548548 }
549549
550+ function test_primaryFilter() {
551+ var dashContentList = findChild(dashContent, "dashContentList");
552+ tryCompareFunction(function() { return findChild(dashContentList.currentItem, "dashNavigation") != null; }, true);
553+ dashContentList.currentItem.item.scope.setHasNavigation(false);
554+ var peExtraPanel = findChild(dashContentList.currentItem, "peExtraPanel");
555+ var searchButton = findChild(dashContentList.currentItem, "search_header_button");
556+
557+ compare(peExtraPanel.visible, false);
558+ mouseClick(searchButton);
559+ tryCompare(peExtraPanel, "visible", true);
560+
561+ tryCompareFunction(function() { return findChild(peExtraPanel, "OSF3") != null; }, true);
562+ }
563+
550564 function test_searchHint() {
551565 var dashContentList = findChild(dashContent, "dashContentList");
552566 verify(dashContentList !== null);