hex icon indicating copy to clipboard operation
hex copied to clipboard

WebAuth Client MVP

Open Benjamin-Philip opened this issue 4 years ago • 7 comments

See https://github.com/hexpm/hexpm/issues/1024.

Benjamin-Philip avatar Dec 14 '21 09:12 Benjamin-Philip

As of right now, there are no tests due to the following issues:

  • I need to get mix task output in order to submit the user code
  • I need to mock a logged in user at /login/web_auth/submit

Benjamin-Philip avatar Dec 14 '21 09:12 Benjamin-Philip

I need to get mix task output in order to submit the user code

All output is sent to the current test process. You can assert on it like this: https://github.com/hexpm/hex/blob/main/test/mix/tasks/hex.info_test.exs#L18.

I need to mock a logged in user at /login/web_auth/submit

If you need an endpoint on hexpm that does this you can add it here: https://github.com/hexpm/hexpm/blob/main/lib/hexpm_web/router.ex#L279-L298.

ericmj avatar Dec 14 '21 13:12 ericmj

If you need an endpoint on hexpm that does this you can add it here:

Are you suggesting that I call the WebAuth.submit function from the TestController with some random user?

Benjamin-Philip avatar Dec 14 '21 13:12 Benjamin-Philip

Are you suggesting that I call the WebAuth.submit function from the TestController with some random user?

I am not sure what you need to do, but if you need a user to perform a webauth submit in a test scenario that could be one way of doing it.

ericmj avatar Dec 14 '21 13:12 ericmj

@ericmj and @wojtekmach , I have got a working task ready. Here's a video showing the task:

https://user-images.githubusercontent.com/67545861/147077732-abfb6ce5-e2ca-42f8-b758-c27202655e73.mp4

Note: I think the frame rate is slow again, but now I think it's my screen recorder's fault.

Benjamin-Philip avatar Dec 22 '21 10:12 Benjamin-Philip

@ericmj, @wojtekmach Ping.

Benjamin-Philip avatar Jan 02 '22 04:01 Benjamin-Philip

I noticed that you ran the CI on the PR. The tests will fail until the backend PR has been merged.

If you would like to run the tests, I suggest that you checkout the PRs locally.

Benjamin-Philip avatar Feb 11 '22 10:02 Benjamin-Philip