summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorNiels De Graef <nielsdegraef@gmail.com>2023-03-01 08:53:54 +0100
committerNiels De Graef <nielsdegraef@gmail.com>2023-03-02 07:31:29 +0000
commit0abbc2883e0c570ef84246aa3c8b735ba2a8eea2 (patch)
tree14d1c8f9f0e2702c64803817b99a76597a756a2a /tests
parente594ee436db947725d6aab8ecb40117bcbced10b (diff)
downloadgnome-contacts-0abbc2883e0c570ef84246aa3c8b735ba2a8eea2.tar.gz
addresses-chunk: properly notify is-empty
We weren't sending out a property notification for `is-empty` when the underlying `Folks.PostalAddress` changed, which meant that editing a contact would only allows for a single address. Also add a test to make sure we're not regressing on this.
Diffstat (limited to 'tests')
-rw-r--r--tests/core/test-addresses-chunk.vala5
1 files changed, 5 insertions, 0 deletions
diff --git a/tests/core/test-addresses-chunk.vala b/tests/core/test-addresses-chunk.vala
index 83ebb61..685c6bd 100644
--- a/tests/core/test-addresses-chunk.vala
+++ b/tests/core/test-addresses-chunk.vala
@@ -44,9 +44,14 @@ private void test_is_empty () {
assert_true (address.is_empty);
assert_true (chunk.is_empty);
+ // Make sure that the notify works correctly for the address too
+ bool notified = false;
+ address.notify["is-empty"].connect ((o, p) => { notified = true; });
+
address.address.street = "Yellow brick road";
assert_false (address.is_empty);
assert_false (chunk.is_empty);
+ assert_true (notified);
address.address.street = "";
assert_true (address.is_empty);