Skip to content

Commit

Permalink
solution
Browse files Browse the repository at this point in the history
  • Loading branch information
minimal005 committed Dec 18, 2024
1 parent 2dc154d commit 87a1300
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions cypress/integration/page.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ describe('', () => {
button().should('have.text', 'Choose a user');
});

it.skip('should not show users list by default', () => {
it('should not show users list by default', () => {
el().should('not.have.class', 'is-active');
el().find('.dropdown-menu').should('not.be.visible');
});
Expand All @@ -337,13 +337,13 @@ describe('', () => {
users().eq(0).should('be.visible');
});

it.skip('should have names in the list', () => {
it('should have names in the list', () => {
users().eq(0).should('have.text', 'Leanne Graham');
users().eq(3).should('have.text', 'Patricia Lebsack');
users().eq(9).should('have.text', 'Clementina DuBuque');
});

it.skip('should close dropdown after selecting a user', () => {
it('should close dropdown after selecting a user', () => {
button().click();
users().eq(3).click();

Expand Down
6 changes: 3 additions & 3 deletions src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export const App = () => {
const [postSelected, setPostSelected] = useState<Post | null>(null);

const [isError, setIsError] = useState(false);
const [isLoading, setIsLoadind] = useState(false);
const [isLoading, setIsLoading] = useState(false);
const [isActiveListUsers, setIsActiveListUsers] = useState(false);

useEffect(() => {
Expand All @@ -28,7 +28,7 @@ export const App = () => {
}

setPostSelected(null);
setIsLoadind(true);
setIsLoading(true);
const getPostsByUser = async () => {
try {
const postsUser = await postsService.getPosts(userSelectedId);
Expand All @@ -39,7 +39,7 @@ export const App = () => {
setIsError(true);
setPostsByUser([]);
} finally {
setIsLoadind(false);
setIsLoading(false);
}
};

Expand Down
4 changes: 2 additions & 2 deletions src/components/NewCommentForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export const NewCommentForm: React.FC<Props> = props => {
setIsLoading(false);
};

const validateform = () => {
const validateForm = () => {
setIsNameError(!name.length);
setIsEmailError(!email.length);
setIsCommentError(!commentText.length);
Expand All @@ -44,7 +44,7 @@ export const NewCommentForm: React.FC<Props> = props => {
const handleAddComment = async (event: React.FormEvent<HTMLFormElement>) => {
event.preventDefault();

if (validateform()) {
if (validateForm()) {
return;
}

Expand Down

0 comments on commit 87a1300

Please sign in to comment.