Skip to content

Commit

Permalink
Add negative tests
Browse files Browse the repository at this point in the history
  • Loading branch information
niveathika committed Nov 11, 2023
1 parent 9390e52 commit 53c9fba
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions dashboard/tests/utils_test.bal
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand All @@ -16,11 +17,13 @@ function getReleaseBadgeTest() {
@test:Config
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
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
Expand Down

0 comments on commit 53c9fba

Please sign in to comment.