Ghost/apps/admin-x-settings/test/unit/utils/showDatabaseWarning.test.ts
Ronald Langeveld f4a36ecba4
Fixed link to release in About modal (#18588)
no issue

- the link to the release has `-moya` added to it, which breaks the link
to the github release. This ensures it gets removed should it be there
to avoid broken links.

---

<!-- Leave the line below if you'd like GitHub Copilot to generate a
summary from your commit -->
<!--
copilot:summary
-->
### <samp>🤖 Generated by Copilot at f13886c</samp>

Refactored the `About.tsx` component to extract some utility functions
to separate modules. Added unit tests for the extracted functions in the
`test/unit/utils` folder. The refactoring improves code organization and
reusability, and the tests increase the code coverage and reliability.
2023-10-12 08:37:56 +07:00

21 lines
829 B
TypeScript

import * as assert from 'assert/strict';
import {showDatabaseWarning} from '../../../src/utils/showDatabaseWarning';
describe('showDatabaseWarning', function () {
it('shows a warning when in production and not using MySQL 8', function () {
assert.equal(showDatabaseWarning('production', 'mysql5'), true);
});
it('shows a warning when in development and using MySQL 5', function () {
assert.equal(showDatabaseWarning('development', 'mysql5'), true);
});
it('does not show a warning when in production and using MySQL 8', function () {
assert.equal(showDatabaseWarning('production', 'mysql8'), false);
});
it('does not show a warning when in development and using MySQL 8', function () {
assert.equal(showDatabaseWarning('development', 'mysql8'), false);
});
});