Skip to content

<fix errors>#81

Open
Margarita926 wants to merge 2 commits into
mate-academy:mainfrom
Margarita926:task_solution
Open

<fix errors>#81
Margarita926 wants to merge 2 commits into
mate-academy:mainfrom
Margarita926:task_solution

Conversation

@Margarita926

Copy link
Copy Markdown

add new plugins: ESLint, Prettier, Husky and Lint-Staged
and use them to corrected 10/10 errors

@mateacademy-ai-mentor mateacademy-ai-mentor left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Review Summary

The tooling infrastructure is correctly set up, but there are critical functional bugs that must be fixed. HomePage.js line 10 has a method named assertYourFeedTabIsVisible that uses toBeHidden() instead of toBeVisible() — after successful sign-in/sign-up, the 'Your Feed' tab should be visible, not hidden. This bug will cause all positive authentication tests to fail (signInPositive.spec.js line 25 and signUpPositive.spec.js line 28 expect the tab to be visible). Additionally, three test files contain empty destructured parameters async ({}) that trigger ESLint no-unused-vars errors: signInNegative.spec.js, signUpNegative.spec.js, and signUpPositive.spec.js. Remove the empty braces or use the destructured values to resolve these ESLint warnings. The ESLint configuration structure itself looks correct with the flat config format.


✨ Please rate this review in the Platform's notification center1. I will be grateful for your feedback! ✨

Important

Fix the issues, commit the changes, and then re-request my review using the Re-request review button2 in the Reviewers tab.

Tip

If you have any comments about this review, please leave a message in the Add a comment section below and mention me with the @mateacademy-ai-mentor tag3.
I will read your message during my next review of your pull request. Please do not reply directly to my comments, as that feature is not supported yet.

Caution

Do not close the pull request until the review is complete. Closing it early can lead to unexpected behavior and disrupt the review process.

Footnotes

  1. Rate AI review example

  2. Re-request AI review example

  3. Add AI review comments example

Comment thread src/pages/SignUpPage.js
Comment on lines +9 to +10
this.signUpButton = page.getByRole('button', { name: 'Sign up' });
this.errorMessage = page.getByRole('list').nth(1);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

The method name is 'assertYourFeedTabIsVisible' but it calls 'toBeHidden()'. According to the signInPositive.spec.js test, after successful sign-in the 'Your Feed' tab should be VISIBLE, not hidden. This assertion will cause test failures.

Comment thread src/pages/SignInPage.js
this.passwordField = page.getByPlaceholder('Password');
this.signInButton = page.getByRole('button', { name: 'Sign in' });
this.errorMessage = page.getByRole('list').nth(1);
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

The assertion checks if the tab is hidden (toBeHidden()), but based on the test flow (signing in should make the user's feed visible), this should likely be toBeVisible() instead. A user feed tab would be expected to appear after successful authentication.

Comment thread src/pages/HomePage.js Outdated
Comment on lines +9 to +10
async assertYourFeedTabIsVisible() {
await expect(this.yourFeedTab).toBeVisible();
await expect(this.yourFeedTab).toBeHidden();

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

The method is named assertYourFeedTabIsVisible but uses toBeHidden() assertion. After successful authentication, the 'Your Feed' tab should be visible, not hidden. This should be toBeVisible() to match the method name and test intent.

Comment thread eslint.config.mjs
Comment on lines +9 to +10
{ languageOptions: { globals: globals.node } },
{

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

The assertion checks for .toBeHidden(), but after successful sign-in the 'Your Feed' tab should be VISIBLE. This assertion is logically inverted and will cause test failures.

Comment thread eslint.config.mjs
},
eslintConfigPrettier,
];

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Empty destructuring {} is an unused parameter. Consider removing it or using the destructured value.

`username:Username must start with a letter, have no spaces, and be 2 - 40 characters.`,
);
});

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Empty destructured parameter '{}' contains no destructured values - this is unnecessary and will trigger ESLint no-unused-vars warnings.

Comment on lines 9 to 10
await signInPage.open();
});

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This bug causes the positive tests to fail. After successful authentication, the 'Your Feed' tab should be VISIBLE, not hidden. The assertion should be .toBeVisible() to match the test expectation on line 25 of signInPositive.spec.js and line 28 of signUpPositive.spec.js.

Comment on lines 9 to +10
let user;
test.beforeEach( async ({ page }) => {
signUpPage = new SignUpPage(page);
homePage = new HomePage(page);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This method is named 'assertYourFeedTabIsVisible' but calls 'toBeHidden()'. The test expectations (signInPositive.spec.js line 25, signUpPositive.spec.js line 28) show that after successful authentication, the 'Your Feed' tab should be visible, not hidden. This assertion is logically inverted and will cause tests to fail.

username: `${faker.person.firstName()}_${faker.person.lastName()}`,
email: faker.internet.email(),
password: faker.internet.password(),
};

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Empty destructuring '{}' is an unused parameter that will trigger ESLint error for 'no-unused-vars'. Either remove the destructuring or use the destructured value.

Comment thread tests/signUp/signUpPositive.spec.js

@mateacademy-ai-mentor mateacademy-ai-mentor left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Review Summary

Your solution is approved. All previously identified critical bugs have been successfully resolved: HomePage.js now correctly uses toBeVisible() for the assertYourFeedTabIsVisible method, and all test files (signInNegative.spec.js, signUpNegative.spec.js, signUpPositive.spec.js) properly destructure { page } from the test context, eliminating the ESLint no-unused-vars errors. The ESLint configuration is correctly structured using the flat config format with appropriate plugins and rules. All task requirements are met and the implementation is complete.


✨ Please rate this review in the Platform's notification center1. I will be grateful for your feedback! ✨

Footnotes

  1. Rate AI review example

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