on xenial help sign in
check that if no navigation is around the primary filter is shown
dd7410aAlbert Astals Cid
tests/mocks/Unity/fake_scope.cpp+3−1
@@ -49,7 +49,7 @@ Scope::Scope(QString const& id, QString const& name, bool favorite, Scopes* pare
49 , m_filters(new Filters(this))
49 , m_filters(new Filters(this))
50 , m_returnNullPreview(returnNullPreview)
50 , m_returnNullPreview(returnNullPreview)
51{
51{
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);
53}
53}
54
54
55QString Scope::id() const
55QString Scope::id() const
@@ -235,6 +235,7 @@ bool Scope::hasNavigation() const
235void Scope::setHasNavigation(bool hasNavigation)
235void Scope::setHasNavigation(bool hasNavigation)
236{
236{
237 m_hasNavigation = hasNavigation;
237 m_hasNavigation = hasNavigation;
238+ Q_EMIT hasNavigationChanged();
238}
239}
239
240
240Scope::Status Scope::status() const
241Scope::Status Scope::status() const
@@ -329,6 +330,7 @@ void Scope::resetPrimaryNavigationTag()
329void Scope::setHasPrimaryFilter(bool hasPrimaryFilter)
330void Scope::setHasPrimaryFilter(bool hasPrimaryFilter)
330{
331{
331 m_hasPrimaryFilter = hasPrimaryFilter;
332 m_hasPrimaryFilter = hasPrimaryFilter;
333+ Q_EMIT primaryNavigationFilterChanged();
332}
334}
333
335
334void Scope::performQuery(const QString& query)
336void Scope::performQuery(const QString& query)
tests/qmltests/Dash/tst_DashContent.qml+14
@@ -547,6 +547,20 @@ Item {
547 verify(filtersPopover);
547 verify(filtersPopover);
548 }
548 }
549
549
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+
550 function test_searchHint() {
564 function test_searchHint() {
551 var dashContentList = findChild(dashContent, "dashContentList");
565 var dashContentList = findChild(dashContent, "dashContentList");
552 verify(dashContentList !== null);
566 verify(dashContentList !== null);