Closed jejoivanic closed 4 years ago
Why is this a WIP?
I implemented a solution which requires the user to handle the asyn response from the authentication with a then
. In this then
's callback the user receives a parameter which represents the error of the response if any. If not, the layout will change and nothing should be received in this parameter.
...
this.va.login(user, password)
.then(err => {
if (err)
doSomething()
})
...
I've thought about this solution but I don't really know if this is the right approach for this, however I could not find a better way. I've consider passing also the user, to resemble other libraries which, in similar cases, defines a callback like (data, err) => { ... }
.
That's my only concern about this solution. I'll wait for some comments or feedback.
I also modified the response from the demo server to return 401 status when the user or password is incorrect.
Not really sure what's going on. My guess is that the snackbar disappears before Cypress finally finds it in the virtual dom.
Note: this only happens during the CI, local e2e tests pass successfully.
Keeps failing, even with a timeout of 0
. I'm going to temporarily remove those tests. It's not a big trouble since the plan is to move the demo to another repository, therefore e2e tests will not be part of the source code anymore.
End to end tests for AuthLayout
snackbar were removed in 3326fe18eba3d0d13e124adac5a862495b66223b
Description
This PR provides:
Closes https://github.com/Cambalab/vue-admin/issues/180
Type of change
How Has This Been Tested?
Apart from running all previous tests (unit/e2e) two different e2e tests were added. Those are
Checklist: