-
Notifications
You must be signed in to change notification settings - Fork 288
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
test: Add tests #269
base: main
Are you sure you want to change the base?
test: Add tests #269
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great job on meeting the task requirements! 🎉 Your code is well-structured and covers all necessary functionalities. Just double-check the faker
library methods to ensure compatibility with your version. Keep up the excellent work! 🚀
✨ Please rate this review in the Platform's notification center. I will be grateful for your feedback! ✨
on('task', { | ||
generateUser() { | ||
return { | ||
name: faker.person.firstName(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ensure that faker.person.firstName()
is the correct method for generating a first name in the version of @faker-js/faker
you are using. Method names can vary between different versions or libraries.
generateUser() { | ||
return { | ||
name: faker.person.firstName(), | ||
lastName: faker.person.lastName(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ensure that faker.person.lastName()
is the correct method for generating a last name in the version of @faker-js/faker
you are using.
name: faker.person.firstName(), | ||
lastName: faker.person.lastName(), | ||
email: faker.internet.email(), | ||
age: faker.number.int({ max: 100 }), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ensure that faker.number.int()
is the correct method for generating an integer in the version of @faker-js/faker
you are using. Method names can vary between different versions or libraries.
lastName: faker.person.lastName(), | ||
email: faker.internet.email(), | ||
age: faker.number.int({ max: 100 }), | ||
salary: faker.number.int({ min: 600, max: 12000 }), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ensure that faker.number.int()
is the correct method for generating an integer within a range in the version of @faker-js/faker
you are using.
email: faker.internet.email(), | ||
age: faker.number.int({ max: 100 }), | ||
salary: faker.number.int({ min: 600, max: 12000 }), | ||
department: faker.person.jobArea() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ensure that faker.person.jobArea()
is the correct method for generating a job area in the version of @faker-js/faker
you are using.
it('should find a worker and edit their data', () => { | ||
cy.addNewWorker(user); | ||
|
||
cy.getGroupUser(user).then((row) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ensure that the custom command cy.getGroupUser(user)
is defined and correctly implemented. This command should handle retrieving the row corresponding to the user.
cy.addNewWorker(user); | ||
|
||
cy.getGroupUser(user).then((row) => { | ||
cy.getByTitle(row, 'Edit'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ensure that the custom command cy.getByTitle(row, 'Edit')
is defined and correctly implemented. This command should handle finding the 'Edit' button within the specified row.
}); | ||
|
||
cy.task('generateUser').then((changeWorker) => { | ||
cy.changeWorkerData(changeWorker); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ensure that the custom command cy.changeWorkerData(changeWorker)
is defined and correctly implemented. This command should handle changing the worker data with the new user information.
cy.task('generateUser').then((changeWorker) => { | ||
cy.changeWorkerData(changeWorker); | ||
|
||
cy.getGroupUser(changeWorker).then((row) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ensure that the custom command cy.getGroupUser(changeWorker)
is defined and correctly implemented. This command should handle retrieving the row corresponding to the updated user.
cy.changeWorkerData(changeWorker); | ||
|
||
cy.getGroupUser(changeWorker).then((row) => { | ||
cy.verifyRowData(row, changeWorker); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ensure that the custom command cy.verifyRowData(row, changeWorker)
is defined and correctly implemented. This command should handle verifying that the row data matches the updated user data.
Have a nice day!