2
* This file is part of system-settings
4
* Copyright (C) 2016 Canonical Ltd.
6
* This program is free software: you can redistribute it and/or modify it
7
* under the terms of the GNU General Public License version 3, as published
8
* by the Free Software Foundation.
10
* This program is distributed in the hope that it will be useful, but
11
* WITHOUT ANY WARRANTY; without even the implied warranties of
12
* MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
13
* PURPOSE. See the GNU General Public License for more details.
15
* You should have received a copy of the GNU General Public License along
16
* with this program. If not, see <http://www.gnu.org/licenses/>.
21
import Ubuntu.Components 1.3
22
import Ubuntu.Connectivity 1.0
23
import Ubuntu.DownloadManager 1.2
24
import Ubuntu.SystemSettings.Update 1.0
25
import Ubuntu.Test 0.1
43
// Test suite when there's no Image update.
45
name: "EntryComponentNoImageUpdateTestCase"
48
property var instance: null
51
SystemImage.mockTargetBuildNumber(0);
52
SystemImage.mockCurrentBuildNumber(0);
53
instance = entryComponent.createObject(testRoot, {
55
displayName: "System Updates Test",
56
icon: "file:///usr/share/icons/suru/places/scalable/distributor-logo.svg"
63
UpdateManager.model.reset();
66
function test_defaultVisibility() {
67
compare(instance.height, 0, "default visibility was wrong");
70
function test_clickUpdates() {
71
UpdateManager.model.mockAddUpdate("app" + 0, 0, Update.KindClick);
72
tryCompare(instance, "height", units.gu(7), 5000, "item did not have the correct height when we had click updates");
76
// Test suite for when we have an image update.
78
name: "EntryComponentImageUpdateTestCase"
81
property var instance: null
84
SystemImage.mockCurrentBuildNumber(0);
85
SystemImage.mockTargetBuildNumber(1);
86
instance = entryComponent.createObject(testRoot, {
88
displayName: "System Updates Test",
89
icon: "file:///usr/share/icons/suru/places/scalable/distributor-logo.svg"
96
UpdateManager.model.reset();
99
function test_visibleWhenImageUpdate() {
100
tryCompare(instance, "height", units.gu(7), 5000, "item did not have the correct height when we had image updates");
103
function test_clickUpdates() {
104
UpdateManager.model.mockAddUpdate("app" + 0, 0, Update.KindClick);
105
tryCompare(instance, "height", units.gu(7), 5000, "item did not have the correct height when we had all types of updates");