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

test: Add tests #269

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

test: Add tests #269

wants to merge 1 commit into from

Conversation

Galers
Copy link

@Galers Galers commented Jan 25, 2025

Have a nice day!

Copy link

@mateacademy-ai-mentor mateacademy-ai-mentor left a 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(),

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(),

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 }),

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 }),

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()

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) => {

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');

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);

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) => {

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);

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.

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