2
* Copyright 2016 Canonical Ltd.
4
* This program is free software; you can redistribute it and/or modify
5
* it under the terms of the GNU General Public License as published by
6
* the Free Software Foundation; version 3.
8
* This program is distributed in the hope that it will be useful,
9
* but WITHOUT ANY WARRANTY; without even the implied warranty of
10
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11
* GNU General Public License for more details.
13
* You should have received a copy of the GNU General Public License
14
* along with this program. If not, see <http://www.gnu.org/licenses/>.
19
import Ubuntu.Components 1.3
20
import "../../../../qml/Dash/Filters"
21
import Unity.Test 0.1 as UT
28
color: theme.palette.selected.background
33
property string title: "Expand me!"
34
property ListModel filters: ListModel {
43
property int value: 30
44
property int minValue: 10
45
property int maxValue: 150
47
property ListModel values: ListModel {
67
Component.onCompleted: {
68
widgetData1.filters.append({"type": Filters.ValueSliderFilter, "filter": sliderObject, id: "trololo"});
73
widgetId: "testExpandableWidget"
74
widgetType: Filters.ExpandableFilterWidget
75
widgetData: widgetData1
80
height: implicitHeight
85
name: "FilterExpandableWidget"
88
function test_expandedChanges() {
89
var expandingItem = findChild(factory, "expandingItem");
90
verify(!expandingItem.expanded)
91
compare(expandingItem.height, expandingItem.collapsedHeight)
92
mouseClick(expandingItem);
93
verify(expandingItem.expanded)
94
tryCompare(expandingItem, "height", expandingItem.expandedHeight)
95
verify(expandingItem.collapsedHeight < expandingItem.expandedHeight / 2);