mirror of
https://github.com/status-im/status-desktop.git
synced 2025-01-09 13:56:10 +00:00
ab61784816
* chore: bump status-go * (fix/desktop) removing custom picture is not reflected on contact's side This PR fixes [9947](#9947) and contains : - Commit to fix the changing of custom picture and having the change reflected on contact's side - Commit to fix the deleting of picture and having the change reflected on contact's side
28 lines
1.0 KiB
Nim
28 lines
1.0 KiB
Nim
import unittest, strutils
|
|
|
|
import app/global/utils/time_utils
|
|
|
|
suite "adding timestamp to url":
|
|
test "adding timestamp to an image url with query containing ?":
|
|
let url = "https://Localhost:35651/contactImages?imageName=thumbnail?publicKey=0x04d76f84ec"
|
|
let result = time_utils.addTimestampToURL(url)
|
|
|
|
check(result.startsWith(url & "×tamp="))
|
|
|
|
test "adding timestamp to an image url with query containing &":
|
|
let url = "https://Localhost:35651/contactImages&imageName=thumbnail&publicKey=0x04d76f84e8dc"
|
|
let result = time_utils.addTimestampToURL(url)
|
|
|
|
check(result.startsWith(url & "?timestamp="))
|
|
|
|
test "image contains a mix of & and ? queries, & is added":
|
|
let url = "https://Localhost:35651/contactImages?imageName=thumbnail&publicKey=0x04d76f84e8dc"
|
|
let result = time_utils.addTimestampToURL(url)
|
|
|
|
check(result.startsWith(url & "×tamp="))
|
|
|
|
test "adding timestamp to an empty image url":
|
|
let result = time_utils.addTimestampToURL("")
|
|
|
|
let expectedResult = ""
|
|
check(result == expectedResult) |