TestBuildAuthURL verifies that the buildAuthURL function correctly constructs OAuth authentication URLs with proper state and return URI parameters.
(t *testing.T)
| 134 | // TestBuildAuthURL verifies that the buildAuthURL function correctly constructs |
| 135 | // OAuth authentication URLs with proper state and return URI parameters. |
| 136 | func TestBuildAuthURL(t *testing.T) { |
| 137 | state := "test_state_123" |
| 138 | returnURI := "http://127.0.0.1:8080/callback" |
| 139 | |
| 140 | url := buildAuthURL(state, returnURI) |
| 141 | |
| 142 | assert.Contains(t, url, "https://console.thundercompute.com/login/app") |
| 143 | assert.Contains(t, url, "state=test_state_123") |
| 144 | assert.Contains(t, url, "return_uri=http%3A%2F%2F127.0.0.1%3A8080%2Fcallback") |
| 145 | } |
| 146 | |
| 147 | // TestOpenBrowser verifies that the openBrowser function doesn't panic when |
| 148 | // called with a valid URL, even if the actual browser opening fails. |
nothing calls this directly
no test coverage detected