tests: Check that Bluetooth section is not shown

This simply ensure the section does not randomly show up after making
unrelated changes.
This commit is contained in:
Benjamin Berg 2018-05-24 18:42:58 +02:00
parent ab59a8f658
commit d45512d680

View file

@ -184,6 +184,7 @@ test_second_device_add_remove (NetworkPanelFixture *fixture,
{ {
NMDevice *device; NMDevice *device;
const gchar *device_path; const gchar *device_path;
GtkWidget *bt_header;
test_device_add (fixture, user_data); test_device_add (fixture, user_data);
@ -198,9 +199,14 @@ test_second_device_add_remove (NetworkPanelFixture *fixture,
nmtst_remove_device (fixture->sinfo, fixture->client, device); nmtst_remove_device (fixture->sinfo, fixture->client, device);
g_debug("Second device removed again\n"); g_debug("Second device removed again\n");
/* eth1000 should be labeled "Wired" again */
g_assert_nonnull (gtk_test_find_label (fixture->shell, "Wired")); g_assert_nonnull (gtk_test_find_label (fixture->shell, "Wired"));
g_assert_null (gtk_test_find_label (fixture->shell, "Ethernet (eth1000)")); g_assert_null (gtk_test_find_label (fixture->shell, "Ethernet (eth1000)"));
g_assert_null (gtk_test_find_label (fixture->shell, "Ethernet (eth1001)")); g_assert_null (gtk_test_find_label (fixture->shell, "Ethernet (eth1001)"));
/* Some more checks for unrelated UI not showing up randomly */
bt_header = gtk_test_find_label(fixture->shell, "Bluetooth");
g_assert_false (bt_header && gtk_widget_is_visible(bt_header));
} }
/*****************************************************************************/ /*****************************************************************************/
@ -322,7 +328,7 @@ test_connection_multi_add_activate (NetworkPanelFixture *fixture,
gconstpointer user_data) gconstpointer user_data)
{ {
NMConnection *conn; NMConnection *conn;
GtkWidget *sw; GtkWidget *sw, *bt_header;
g_autoptr(GError) error = NULL; g_autoptr(GError) error = NULL;
/* Add a single connection (just chainging up to other test). */ /* Add a single connection (just chainging up to other test). */
@ -353,6 +359,10 @@ test_connection_multi_add_activate (NetworkPanelFixture *fixture,
/* Hardware address is shown at this point */ /* Hardware address is shown at this point */
g_assert_nonnull (gtk_test_find_label (fixture->shell, "52:54:00:ab:db:23")); g_assert_nonnull (gtk_test_find_label (fixture->shell, "52:54:00:ab:db:23"));
/* Some more checks for unrelated UI not showing up randomly */
bt_header = gtk_test_find_label(fixture->shell, "Bluetooth");
g_assert_false (bt_header && gtk_widget_is_visible(bt_header));
} }
int int