Okay.
And up next, let's set up the test user.
And as a result, the regular user who comes to the application doesn't need to log in or register effectively.
They can just test it out.
And we're going to start by logging out.
And then.
The name here is up to you.
Same goes for email and password.
Just keep in mind that of course it's going to be visible.
Meaning if let's say somebody wants to go and check out the password in DevTools, they will be able
to do it.
Don't worry.
Of course we will restrict certain actions for that test user, but let's say a password, it doesn't
really make sense to come up with anything really complex since it's going to be visible in DevTools.
So let's start here with name.
I'm going to go with test user again.
You'll be able to change those values later technically.
So don't worry if you don't have right away the same as me yet.
I'm going to go test user at test dot com.
And then as far as the password, again, in my case, I'm going to go with secret because it doesn't
really make a difference.
So I create that user.
Let me go and check it out.
Let me refresh and we want to get the ID.
Because for a test user, since bunch of things that are going to be restricted, but we still want
a regular person who comes to application, see the features, well, we might as well add some jobs.
Correct?
So at least they can search for stuff and all kinds of things.
So we want to grab that idea and we want to run again that populate remember the one that I showed you
with that macro data?
So we'll do this again one more time and this one is going to be for that test user.
So we want to go back to the project and in here, remember the mock data.
This is where I copy and pasted the previous ID.
So now I'll do that with the test user, so not let me find it.
This is the user over here and let's just take this value.
So we're looking for that ID, We go back to the mock data, select again all the instances of created
by.
And then once we set this one up, we'll copy and paste.
So that's my test user and I'll stop.
My project.
Clear and then we'll go with Node and then populate if you need a refresher.
And this is the logic over here.
And I say, No, we can delete this job.
Delete.
Many technically don't need it, so maybe we don't want to remove the previous jobs.
We just want to add a new one.
Basically all those jobs for that test user.
So let's go with node populate, let's invoke it.
And now our test user should also have those jobs.
Those, I believe, 75.
So let me go back over here.
And refresh.
And then lastly, we want to clear everything and we want to set up the login.
So we don't want the user to log in or register if they just want to test the application, we want
to set up a separate button.
So, yes, this is my test user.
I was able to log in and everything and as set out I should see those 75.
Yep.
Notice.
So this is going to be basically my dummy data.
But before we restrict the access for this test user.
I want to set up a button that basically logs in.
Now, the gotcha here is that we simply want to set up a button, and when we invoke this button, we
want to provide those values that email as well as the password that we just set up.
So let's try this one out.
I'm going to go to register in this case.
So let me look for pages and we're looking for register one.
So let me find what my.
Find where it is.
Page is over here, client.
And then register.
So notice that we invoke the set up user.
On submit, correct?
But now what I want to do is to add another button right below the submit one where effectively I'm
just going to straight up invoke the SAP user.
So how is that going to look like?
Well, right after submit, we're going to go with button and then we'll add type button.
So this is not a submit one.
It's going to be type button and then we'll add class name.
BTN, BTN, BLOCK and BTN Hipster.
Just so the colours are a little bit different and then same deal for is loading.
So while we're loading.
We won't be able to press the button and then we want to go on click and now we want to invoke it.
So instead of waiting for on submit, we'll invoke the setup user once we click on that demo user or
whatever button.
So first let me take the setup user.
Let me scroll down and we'll have to hardcoded those values.
Correct.
Because remember, we just set up that demo user.
So let's go over here.
Let's say that.
We have on click.
Once we.
Click on a button we want to invoke set up user.
Now we just need to hardcoded them so it's not going to be current user.
The endpoint is not going to be register.
We'll actually log in since we already created and then alert text.
So the same or actually copy and paste the wrong one.
So no, we'll say log in successful.
So now we're redirecting and then the current user, I'm not grabbing those values from the state.
I'll actually provide a new one.
I'll say, Yep, it's going to be an object.
And as far as the email.
Now make sure that it matches whatever you have in a database.
So in my case, that is best user at Ask.com because again, we're just performing a logging from the
button.
That's all we're doing.
There's really no magic in there.
So test user ETFs dot com, that's my email.
So that's one I need to provide test user.
By the way, capital case at Test dotcom.
And then as far as the password, look, I said we need to basically provide the password we just set
up.
So in my case, I believe it was secret.
Hopefully I'm correct.
So let me save it.
And in the button, basically, again, we want to set up that logic where if we're loading, then we'll
just display loading.
And then if we're not, then we'll say demo app.
So let's say here is loading on.
If it's true, then we'll go loading, loading, loading that basically.
And as I'm sitting here, the question mark, if we're not loading and we'll say demo app or test user,
that is the real app to you.
So now let me go back to the application.
Notice this is the demo app and I know I already said this 10,000 times, but basically the moment we
click on a button.
We perform a login.
That's it.
That's all we do.
And we log in with those values that were just set up for that test user.
So once you click on this log in, successful blah, blah, blah, and we're good to go, essentially
we can come in and test out the application.
Now, next, like I said, I'll restrict.
The access to the user because I don't want anybody to just come here and start messing with job values
and all that.
I want to kind of keep this as 75 jobs with all of these values.
So if you want to make some changes to this test user, for example, last time in my city, then I
suggest doing that right now.
So for example, in my case, I'm going to say shake and bake.
And then for location, I'm going to say vegan food truck like so.
So save this one still works.
But in the upcoming video, we'll restrict access to this test user.
So the test user is basically read only.
The user can come here, take a look at the application, but he or she cannot add jobs, delete jobs,
modify jobs, or change the profile.