From 04c9477f736ede59e1f0b9f3907659a86832bf5a Mon Sep 17 00:00:00 2001 From: Alphonse Mariya Date: Sun, 24 Feb 2019 19:21:04 +0100 Subject: [PATCH] test: Test notification resizing on text change --- tests/test-naughty-legacy.lua | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/tests/test-naughty-legacy.lua b/tests/test-naughty-legacy.lua index 4e75806a9..5748e31e2 100644 --- a/tests/test-naughty-legacy.lua +++ b/tests/test-naughty-legacy.lua @@ -689,13 +689,32 @@ table.insert(steps, function() assert(not naughty.suspended) -- Replace the text + assert(n.title == "foo") assert(n.message == "bar") assert(n.text == "bar") - assert(n.title == "foo") + local width, height = n.width, n.height + assert(width) + assert(height) naughty.replace_text(n, "foobar", "baz") assert(n.title == "foobar") assert(n.message == "baz") assert(n.text == "baz") + assert(n.width > width) + assert(n.height == height) + width, height = n.width, n.height + naughty.replace_text(n, "foo", "bar\nbaz") + assert(n.title == "foo") + assert(n.message == "bar\nbaz") + assert(n.text == "bar\nbaz") + assert(n.width < width) + assert(n.height > height) + width, height = n.width, n.height + naughty.replace_text(n, "foo", "bar") + assert(n.title == "foo") + assert(n.message == "bar") + assert(n.text == "bar") + assert(n.width == width) + assert(n.height < height) -- Test the ID system n.id = 1337