Skip to content

Comments

fix: verify csrf token tests#1205

Merged
hwbrzzl merged 3 commits intogoravel:masterfrom
NiteshSingh17:fix-verify-csrf-token-test
Sep 25, 2025
Merged

fix: verify csrf token tests#1205
hwbrzzl merged 3 commits intogoravel:masterfrom
NiteshSingh17:fix-verify-csrf-token-test

Conversation

@NiteshSingh17
Copy link
Contributor

@NiteshSingh17 NiteshSingh17 commented Sep 21, 2025

📑 Description

Closes https://github.com/goravel/goravel/issues/

✅ Checks

  • Added test cases for my code

@NiteshSingh17 NiteshSingh17 requested a review from a team as a code owner September 21, 2025 13:58
@codecov
Copy link

codecov bot commented Sep 21, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 68.13%. Comparing base (15cc675) to head (4b7e07e).
⚠️ Report is 13 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1205      +/-   ##
==========================================
- Coverage   68.55%   68.13%   -0.43%     
==========================================
  Files         228      235       +7     
  Lines       14588    15277     +689     
==========================================
+ Hits        10001    10409     +408     
- Misses       4229     4507     +278     
- Partials      358      361       +3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Contributor

@hwbrzzl hwbrzzl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice 👍

mockSession := mocksession.NewSession(t)

mockCtx.EXPECT().Request().Return(mockRequest).Maybe()
mockRequest.EXPECT().HasSession().Return(tt.hasSession)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add Once

Copy link
Contributor Author

@NiteshSingh17 NiteshSingh17 Sep 22, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have added various counts based on different conditions.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems no? This line and

image

Copy link
Contributor Author

@NiteshSingh17 NiteshSingh17 Sep 23, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, I thought we were talking about "Maybe" 😃

Comment on lines 6 to +9
contractshttp "github.com/goravel/framework/contracts/http"
contractsession "github.com/goravel/framework/contracts/session"
foundationJson "github.com/goravel/framework/foundation/json"
configmocks "github.com/goravel/framework/mocks/config"
"github.com/goravel/framework/session"
sessionMiddleware "github.com/goravel/framework/session/middleware"
"github.com/goravel/framework/support/path"
mockhttp "github.com/goravel/framework/mocks/http"
mocksession "github.com/goravel/framework/mocks/session"
"github.com/stretchr/testify/assert"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
contractshttp "github.com/goravel/framework/contracts/http"
contractsession "github.com/goravel/framework/contracts/session"
foundationJson "github.com/goravel/framework/foundation/json"
configmocks "github.com/goravel/framework/mocks/config"
"github.com/goravel/framework/session"
sessionMiddleware "github.com/goravel/framework/session/middleware"
"github.com/goravel/framework/support/path"
mockhttp "github.com/goravel/framework/mocks/http"
mocksession "github.com/goravel/framework/mocks/session"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/assert"
contractshttp "github.com/goravel/framework/contracts/http"
mockhttp "github.com/goravel/framework/mocks/http"
mocksession "github.com/goravel/framework/mocks/session"

Copy link
Contributor

@hwbrzzl hwbrzzl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, thanks

@hwbrzzl hwbrzzl merged commit 20c63f2 into goravel:master Sep 25, 2025
13 of 14 checks passed
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.

2 participants