From 80c3afdd2db42def308a7a383d9b6e454cc0abdd Mon Sep 17 00:00:00 2001 From: Niveathika Date: Sun, 12 Nov 2023 08:09:51 +0530 Subject: [PATCH] Add negative testcases --- dashboard/tests/utils_test.bal | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/dashboard/tests/utils_test.bal b/dashboard/tests/utils_test.bal index bd6343f2..f1cd565c 100644 --- a/dashboard/tests/utils_test.bal +++ b/dashboard/tests/utils_test.bal @@ -2,6 +2,7 @@ import ballerina/test; const IO_MODULE = "module-ballerina-io"; const JAVA_ARRAYS_MODULE = "module-ballerina-jballerina.java.arrays"; +const GMAIL_MODULE = "module-ballerinax-googleapis.gmail"; @test:Config function getRepoLinkTest() { @@ -13,14 +14,20 @@ function getReleaseBadgeTest() { test:assertEquals(getReleaseBadge(IO_MODULE), "[![GitHub Release](https://img.shields.io/github/v/release/ballerina-platform/module-ballerina-io?sort=semver&color=30c955&label=)](https://github.com/ballerina-platform/module-ballerina-io/releases)"); } -@test:Config +@test:Config { + enable: false +} function getBuildStatusBadgeTest() { test:assertEquals(getBuildStatusBadge(IO_MODULE, "master"), "[![Build](https://img.shields.io/github/actions/workflow/status/ballerina-platform/module-ballerina-io/build-timestamped-master.yml?branch=master&label=)](https://github.com/ballerina-platform/module-ballerina-io/actions/workflows/build-timestamped-master.yml)"); + test:assertEquals(getBuildStatusBadge(GMAIL_MODULE, "master"), "[![Build](https://img.shields.io/github/actions/workflow/status/ballerina-platform/module-ballerinax-googleapis.gmail/ci.yml?branch=master&label=)](https://github.com/ballerina-platform/module-ballerinax-googleapis.gmail/actions/workflows/ci.yml)" ); } -@test:Config +@test:Config { + enable: false +} function getTrivyBadgeTest() { test:assertEquals(getTrivyBadge(IO_MODULE, "master"), "[![Trivy](https://img.shields.io/github/actions/workflow/status/ballerina-platform/module-ballerina-io/trivy-scan.yml?branch=master&label=)](https://github.com/ballerina-platform/module-ballerina-io/actions/workflows/trivy-scan.yml)"); + test:assertEquals(getTrivyBadge(GMAIL_MODULE, "master"), "[![Trivy](https://img.shields.io/badge/-N%2FA-yellow)](https://github.com/ballerina-platform/module-ballerinax-googleapis.gmail/actions/workflows/trivy-scan.yml)"); } @test:Config