summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenjamin Berg <bberg@redhat.com>2018-05-21 13:42:47 +0200
committerBenjamin Berg <bberg@redhat.com>2018-05-29 15:17:50 +0200
commit7c43f95ef967a36dd3c9e64fe0dab63becb1a558 (patch)
tree7e5691d86b34e4b3bc3b3c3b64aeee32aa2da3a9
parentf3322b495c32929896c78f82d883cd5828539d7a (diff)
downloadgnome-control-center-7c43f95ef967a36dd3c9e64fe0dab63becb1a558.tar.gz
tests: Add trivial test to check empty network panel
If there are no connections or devices then we should not be showing e.g. the Bluetooth list. Add a simple check that this is handled correctly.
-rw-r--r--tests/network/test-network-panel.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/tests/network/test-network-panel.c b/tests/network/test-network-panel.c
index a6c8a8ea0..53d2f4b6a 100644
--- a/tests/network/test-network-panel.c
+++ b/tests/network/test-network-panel.c
@@ -116,6 +116,23 @@ fixture_set_up_wired (NetworkPanelFixture *fixture,
/*****************************************************************************/
static void
+test_empty_ui (NetworkPanelFixture *fixture,
+ gconstpointer user_data)
+{
+ GtkWidget *bt_header;
+ GtkWidget *wired_header;
+
+ /* There should be no Wired or Bluetooth sections */
+ wired_header = gtk_test_find_label(fixture->shell, "Wired");
+ g_assert_false (wired_header && gtk_widget_is_visible(wired_header));
+
+ bt_header = gtk_test_find_label(fixture->shell, "Bluetooth");
+ g_assert_false (bt_header && gtk_widget_is_visible(bt_header));
+}
+
+/*****************************************************************************/
+
+static void
test_device_add (NetworkPanelFixture *fixture,
gconstpointer user_data)
{
@@ -328,6 +345,13 @@ main (int argc, char **argv)
gtk_test_init (&argc, &argv, NULL);
+ g_test_add ("/network-panel-wired/empty-ui",
+ NetworkPanelFixture,
+ NULL,
+ fixture_set_up_empty,
+ test_empty_ui,
+ fixture_tear_down);
+
g_test_add ("/network-panel-wired/device-add",
NetworkPanelFixture,
NULL,