Skip to content

Commit eef1498

Browse files
committed
Deploying to gh-pages from @ ffa7509 🚀
1 parent ee218da commit eef1498

1 file changed

Lines changed: 24 additions & 4 deletions

File tree

unit/test-comment-content.sh

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ assert_file_contains "$comment_file" "$action_version"
3636
assert_file_contains "$comment_file" "$preview_url"
3737
assert_file_contains "$comment_file" "Built to branch"
3838
assert_file_contains "$comment_file" "pr-12345"
39-
assert_file_contains "$comment_file" "qr.rossjrw.com" && exit 1 || true
39+
assert_file_contains "$comment_file" "/?url=" && exit 1 || true
4040

4141
echo >&2 "test comment: removal"
4242
echo >&2 "==============================="
@@ -57,11 +57,11 @@ echo >&2 "==============================="
5757
assert_file_contains "$comment_file" "PR Preview Action"
5858
assert_file_contains "$comment_file" "$action_version"
5959
assert_file_contains "$comment_file" "Preview removed"
60-
assert_file_contains "$comment_file" "qr.rossjrw.com" && exit 1 || true
60+
assert_file_contains "$comment_file" "/?url=" && exit 1 || true
6161

6262
echo >&2 "test comment: deployment with QR code"
6363
echo >&2 "==============================="
64-
qr_code_provider="https://qr.rossjrw.com/?url="
64+
qr_code_provider="https://qr.example.com/?url="
6565
bash lib/generate-comment.sh \
6666
"$action_repository" \
6767
"$action_version" \
@@ -77,4 +77,24 @@ qr_code_provider=""
7777
cat >&2 "$comment_file"
7878
echo >&2 "==============================="
7979

80-
assert_file_contains "$comment_file" "qr.rossjrw.com/?url=$preview_url"
80+
assert_file_contains "$comment_file" "qr.example.com/?url=$preview_url"
81+
82+
echo >&2 "test comment: deployment with QR code, backwards compatibility with qr-code:true"
83+
echo >&2 "==============================="
84+
qr_code_provider="true"
85+
bash lib/generate-comment.sh \
86+
"$action_repository" \
87+
"$action_version" \
88+
"$preview_url" \
89+
"$preview_branch" \
90+
"$server_url" \
91+
"$deployment_repository" \
92+
"$action_start_time" \
93+
"deploy" \
94+
"$qr_code_provider" \
95+
> "$comment_file"
96+
qr_code_provider=""
97+
cat >&2 "$comment_file"
98+
echo >&2 "==============================="
99+
100+
assert_file_contains "$comment_file" "qr.rossjrw.com"

0 commit comments

Comments
 (0)