Skip to content

feat(testcase): Added Test-case for jwt.go#58

Merged
yp969803 merged 2 commits intofordevio:mainfrom
yashisrani:add/test-case
Jun 25, 2025
Merged

feat(testcase): Added Test-case for jwt.go#58
yp969803 merged 2 commits intofordevio:mainfrom
yashisrani:add/test-case

Conversation

@yashisrani
Copy link
Copy Markdown
Contributor

Description

Fixes: #6

  • I added a test case for JWT. go

Type of change

What type of changes does your code introduce to the wharf? Put an x in the box that apply.

  • CHANGE (fix or feature that would cause existing functionality to not work as expected)
  • FEATURE (non-breaking change which adds functionality)
  • BUGFIX (non-breaking change which fixes an issue)
  • ENHANCEMENT (non-breaking change which improves existing functionality)
  • NONE (if none of the other choices apply. Example, tooling, build system, CI, docs, etc.)

Verification

Please check the testing guidelines for recommendations about automated tests.
Screenshot 2025-06-22 at 3 12 59 PM

Signed-off-by: Yash Israni <yashisrani52@gmail.com>
@yashisrani yashisrani requested a review from yp969803 as a code owner June 22, 2025 09:44
@yp969803
Copy link
Copy Markdown
Collaborator

yp969803 commented Jun 22, 2025

the three tests of verify_token can be merged into one like this,

func TestVerifyToken(t *testing.T) {
	for _, tc := range [] struct {
		name    string
		token   string
		wantErr bool
	}{
		{
			name:    "Valid token",
			token:	"",
		wantErr: false,
	}, {
			name:    "Invalid token",
			token:  "this.is.an.invalid.token",
			wantErr: true,
	},
	}

	for _, tc := range tests {
		t.Run(tc.name, func(t *testing.T) {

		})
	}

@yp969803
Copy link
Copy Markdown
Collaborator

run make format and make generate also

Signed-off-by: Yash Israni <yashisrani52@gmail.com>
@yp969803
Copy link
Copy Markdown
Collaborator

thanks !

@yp969803 yp969803 merged commit ec5695a into fordevio:main Jun 25, 2025
7 checks passed
yp969803 pushed a commit that referenced this pull request Jul 4, 2025
* feat(testcase): Added Test-case for jwt.go

Signed-off-by: Yash Israni <yashisrani52@gmail.com>

* feat: updated jwt_test

Signed-off-by: Yash Israni <yashisrani52@gmail.com>

---------

Signed-off-by: Yash Israni <yashisrani52@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

write unit tests for pkg/auth/jwt.go in jwt_test.go

2 participants