Skip to content

Homework 16#7

Open
litserkovna wants to merge 2 commits intomasterfrom
homework16
Open

Homework 16#7
litserkovna wants to merge 2 commits intomasterfrom
homework16

Conversation

@litserkovna
Copy link
Owner

@litserkovna litserkovna commented Mar 25, 2024

Please read and mark the following check list before creating a pull request (check one with "x"):

Short description of what this resolves:

Comment on lines 6 to 10
body: JSON.stringify({
title: 'My new title',
body: 'New Body',
userId: 3
}),
Copy link

Choose a reason for hiding this comment

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

it would be better to create a variable for storing request body, you can reuse it in assertions below

Copy link
Owner Author

Choose a reason for hiding this comment

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

Added const requestBody with the details


expect(response.status).to.equal(200);
expect(response.body.userId).to.equal(1);
expect(typeof response.body.id).to.equal('number');
Copy link

Choose a reason for hiding this comment

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

on previous line you check for deep equality with expected value 1

so this assertion is useless, it will always pass

Copy link
Owner Author

Choose a reason for hiding this comment

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

Removed equal('number');

Comment on lines 8 to 9
cy.get('@getFullList').its('body').should('have.length.above', 10)
cy.get('@getFullList').its('body').should('have.length', 100);
Copy link

Choose a reason for hiding this comment

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

why? :)

Copy link
Owner Author

Choose a reason for hiding this comment

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

forgot to remove one :)

@litserkovna litserkovna requested a review from sttaran March 25, 2024 16:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants