change icon from object to string

This commit is contained in:
Hunter Kehoe 2022-07-17 15:40:24 -06:00
parent 04f2535e92
commit 99886d7f66
8 changed files with 23 additions and 77 deletions

View file

@ -123,11 +123,7 @@ func TestToFirebaseMessage_Message_Normal_Allowed(t *testing.T) {
m.Priority = 4
m.Tags = []string{"tag 1", "tag2"}
m.Click = "https://google.com"
m.Icon = &icon{
URL: "https://ntfy.sh/static/img/ntfy.png",
Type: "image/jpeg",
Size: 4567,
}
m.Icon = "https://ntfy.sh/static/img/ntfy.png"
m.Title = "some title"
m.Actions = []*action{
{
@ -178,9 +174,7 @@ func TestToFirebaseMessage_Message_Normal_Allowed(t *testing.T) {
"priority": "4",
"tags": strings.Join(m.Tags, ","),
"click": "https://google.com",
"icon_url": "https://ntfy.sh/static/img/ntfy.png",
"icon_type": "image/jpeg",
"icon_size": "4567",
"icon": "https://ntfy.sh/static/img/ntfy.png",
"title": "some title",
"message": "this is a message",
"actions": `[{"id":"123","action":"view","label":"Open page","clear":true,"url":"https://ntfy.sh"},{"id":"456","action":"http","label":"Close door","clear":false,"url":"https://door.com/close","method":"PUT","headers":{"really":"yes"}}]`,
@ -201,9 +195,7 @@ func TestToFirebaseMessage_Message_Normal_Allowed(t *testing.T) {
"priority": "4",
"tags": strings.Join(m.Tags, ","),
"click": "https://google.com",
"icon_url": "https://ntfy.sh/static/img/ntfy.png",
"icon_type": "image/jpeg",
"icon_size": "4567",
"icon": "https://ntfy.sh/static/img/ntfy.png",
"title": "some title",
"message": "this is a message",
"actions": `[{"id":"123","action":"view","label":"Open page","clear":true,"url":"https://ntfy.sh"},{"id":"456","action":"http","label":"Close door","clear":false,"url":"https://door.com/close","method":"PUT","headers":{"really":"yes"}}]`,