Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Partial testing of submitting bug through chrome index tool - User Story 2 #60

Open
wants to merge 1 commit into
base: sprint2
Choose a base branch
from

Conversation

galishaq
Copy link

@galishaq galishaq commented Oct 20, 2024

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:

Screenshot 2024-10-20 at 11 35 11 PM

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.

Screenshot 2024-10-18 at 2 47 15 AM

before pressing the refresh button :

Screenshot 2024-10-20 at 11 35 58 PM

after pressing the refresh button :

Screenshot 2024-10-20 at 11 36 19 PM

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.

@galishaq galishaq added this to the Sprint 2 milestone Oct 20, 2024
@galishaq galishaq self-assigned this Oct 20, 2024
Copy link

@AlAnoud2003 AlAnoud2003 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code looks great!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

partial testing of bug submtion and bug archive page through crome console - User Story 2
2 participants