Bugfix: Order of arguments passed unit tests but caused invalid parsing

of expire time argument

Modified: How icon argument is called
This commit is contained in:
61825162+CaderIdris@users.noreply.github.com 2024-04-23 12:04:05 +01:00
parent f405233080
commit a663a08bca
No known key found for this signature in database
GPG key ID: CE276296C4FE0169
2 changed files with 3 additions and 3 deletions

View file

@ -61,10 +61,10 @@ function _auto_notify_message() {
fi
local icon_arg=""
if [[ -n "$icon" ]]; then
icon_arg=" --icon=$icon"
icon_arg="--icon=$icon"
fi
notify-send "$title" "$body" --app-name=zsh $transient "--urgency=$urgency" "--expire-time=$AUTO_NOTIFY_EXPIRE_TIME$icon_arg"
notify-send "$title" "$body" --app-name=zsh $transient "--urgency=$urgency" "--expire-time=$AUTO_NOTIFY_EXPIRE_TIME" "$icon_arg"
elif [[ "$platform" == "Darwin" ]]; then
osascript \
-e 'on run argv' \

View file

@ -89,7 +89,7 @@
assert "$lines[1]" same_as 'Notification Title: "f bar -r" Completed'
assert "$lines[2]" same_as "Notification Body: Total time: 20 seconds"
assert "$lines[3]" same_as "Exit code: 0"
assert "$lines[4]" same_as "--app-name=zsh --hint=int:transient:1 --urgency=normal --expire-time=15000"
assert "$lines[4]" same_as "--app-name=zsh --hint=int:transient:1 --urgency=normal --expire-time=15000 "
}
@test 'auto-notify-send sends notification and icon on Linux on success' {