Partial testing of submitting bug through chrome index tool - User Story 2 #60
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
resolves #61
In Google Chrome, using the index tool console , I executed the following command to check the GET API's response:
fetch('http://localhost:4567/api/admin/get-bug-archive')
.then(res => res.json())
.then(console.log)
this showed me if I had the correct API route for rendering the save bugs or not, and also allowed me to view how the GET request behaved. I received a response containing relevant information such as the uid, username, and login status, confirming that the data was being received. The results are shown in the screenshot below:
The second manual test I conducted also in the chrome tool index console:
const csrfToken = '25c3e3378391abeb49587cf2dbaee87d963e77fa9561a54c91fce4440ea47befadba39e2a2fc98eeaeafb7c7dc3b4db8ac42640c1aaf845994a21139443a6b57'; // Replace with your actual CSRF token
const title = 'Test Bug Title';
const description = 'This is a test bug description.';
fetch('http://localhost:4567/api/admin/submit-bug', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'x-csrf-token': csrfToken // Include the CSRF token in the request headers
},
body: JSON.stringify({ title, description }) // Convert the form data to JSON
})
.then(response => response.json())
.then(console.log)
.catch(console.error);
This test allowed me to see whether the data was being submitted to the bug archive page successfully.
before pressing the refresh button :
after pressing the refresh button :
As you can see, the data is being successfully fetched and rendered, but it’s not being recognized as actual text content. This may be happening because the data is being sent through the console log, which could be affecting how it’s displayed.