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

draft: Add unit tests #5412

Draft
wants to merge 5 commits into
base: master
Choose a base branch
from
Draft

Conversation

Airthee
Copy link

@Airthee Airthee commented Apr 23, 2024

Changes
Add unit tests to some utils files.

Issues

Fixes #4872

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

ESLint doesn't pass. Please fix all ESLint issues.

src/utils/card.test.ts Outdated Show resolved Hide resolved
src/utils/card.test.ts Outdated Show resolved Hide resolved
src/utils/card.test.ts Outdated Show resolved Hide resolved
src/utils/card.test.ts Outdated Show resolved Hide resolved
src/utils/card.test.ts Outdated Show resolved Hide resolved
src/utils/dateFnsLocale.test.ts Outdated Show resolved Hide resolved
src/utils/dateFnsLocale.test.ts Outdated Show resolved Hide resolved
src/utils/dateFnsLocale.test.ts Outdated Show resolved Hide resolved
src/utils/dateFnsLocale.test.ts Outdated Show resolved Hide resolved
src/utils/dateFnsLocale.test.ts Outdated Show resolved Hide resolved
@jellyfin-bot
Copy link
Collaborator

Cloudflare Pages deployment

Latest commit f3f652e
Status ✅ Deployed!
Preview URL https://311c3e43.jellyfin-web.pages.dev
Type 🔀 Preview

View build logs
View bot logs

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

ESLint doesn't pass. Please fix all ESLint issues.

src/utils/events.test.ts Outdated Show resolved Hide resolved
src/utils/events.test.ts Outdated Show resolved Hide resolved
src/utils/events.test.ts Outdated Show resolved Hide resolved
src/utils/events.test.ts Outdated Show resolved Hide resolved

expect(obj).toHaveProperty('_callbacks', {
testEvent: [callback]
})
Copy link
Contributor

Choose a reason for hiding this comment

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

Missing semicolon. @typescript-eslint/semi

Fix available:

Suggested change
})
});


expect(obj).toHaveProperty('_callbacks', { testEvent: [initialCallback] });
})
})
Copy link
Contributor

Choose a reason for hiding this comment

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

Missing semicolon. @typescript-eslint/semi

Fix available:

Suggested change
})
});


eventsUtils.trigger(obj, 'testEvent', ['testValue1', 'testValue2']);

expect(callback).toHaveBeenCalledWith({type: 'testEvent'}, 'testValue1', 'testValue2');
Copy link
Contributor

Choose a reason for hiding this comment

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

A space is required after '{'. object-curly-spacing

Fix available:

Suggested change
expect(callback).toHaveBeenCalledWith({type: 'testEvent'}, 'testValue1', 'testValue2');
expect(callback).toHaveBeenCalledWith({ type: 'testEvent'}, 'testValue1', 'testValue2');


eventsUtils.trigger(obj, 'testEvent', ['testValue1', 'testValue2']);

expect(callback).toHaveBeenCalledWith({type: 'testEvent'}, 'testValue1', 'testValue2');
Copy link
Contributor

Choose a reason for hiding this comment

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

A space is required before '}'. object-curly-spacing

Fix available:

Suggested change
expect(callback).toHaveBeenCalledWith({type: 'testEvent'}, 'testValue1', 'testValue2');
expect(callback).toHaveBeenCalledWith({type: 'testEvent' }, 'testValue1', 'testValue2');


expect(callback).toHaveBeenCalledWith({type: 'testEvent'}, 'testValue1', 'testValue2');
});
})
Copy link
Contributor

Choose a reason for hiding this comment

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

Missing semicolon. @typescript-eslint/semi

Fix available:

Suggested change
})
});

expect(callback).toHaveBeenCalledWith({type: 'testEvent'}, 'testValue1', 'testValue2');
});
})
})
Copy link
Contributor

Choose a reason for hiding this comment

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

Missing semicolon. @typescript-eslint/semi

Fix available:

Suggested change
})
});

Copy link

sonarcloud bot commented Apr 27, 2024

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
No data about Duplication

See analysis details on SonarCloud

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

ESLint doesn't pass. Please fix all ESLint issues.


expect(obj).toHaveProperty('_callbacks', { testEvent: [initialCallback] });
});
})
Copy link
Contributor

Choose a reason for hiding this comment

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

Missing semicolon. @typescript-eslint/semi

Fix available:

Suggested change
})
});


eventsUtils.trigger(obj, 'testEvent', ['testValue1', 'testValue2']);

expect(callback).toHaveBeenCalledWith({type: 'testEvent'}, 'testValue1', 'testValue2');
Copy link
Contributor

Choose a reason for hiding this comment

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

A space is required after '{'. object-curly-spacing

Fix available:

Suggested change
expect(callback).toHaveBeenCalledWith({type: 'testEvent'}, 'testValue1', 'testValue2');
expect(callback).toHaveBeenCalledWith({ type: 'testEvent'}, 'testValue1', 'testValue2');


eventsUtils.trigger(obj, 'testEvent', ['testValue1', 'testValue2']);

expect(callback).toHaveBeenCalledWith({type: 'testEvent'}, 'testValue1', 'testValue2');
Copy link
Contributor

Choose a reason for hiding this comment

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

A space is required before '}'. object-curly-spacing

Fix available:

Suggested change
expect(callback).toHaveBeenCalledWith({type: 'testEvent'}, 'testValue1', 'testValue2');
expect(callback).toHaveBeenCalledWith({type: 'testEvent' }, 'testValue1', 'testValue2');

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.

Add tests to the project
2 participants