test: Test notification resizing on text change

This commit is contained in:
Alphonse Mariya 2019-02-24 19:21:04 +01:00
parent 494474ba0a
commit 04c9477f73
No known key found for this signature in database
GPG Key ID: 5771D46E051EAF79
1 changed files with 20 additions and 1 deletions

View File

@ -689,13 +689,32 @@ table.insert(steps, function()
assert(not naughty.suspended) assert(not naughty.suspended)
-- Replace the text -- Replace the text
assert(n.title == "foo")
assert(n.message == "bar") assert(n.message == "bar")
assert(n.text == "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") naughty.replace_text(n, "foobar", "baz")
assert(n.title == "foobar") assert(n.title == "foobar")
assert(n.message == "baz") assert(n.message == "baz")
assert(n.text == "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 -- Test the ID system
n.id = 1337 n.id = 1337