mirror of
https://github.com/scratchfoundation/scratch-www.git
synced 2024-11-30 10:58:23 -05:00
19 lines
718 B
JavaScript
19 lines
718 B
JavaScript
const getScratchWikiLink = require('../../../src/lib/scratch-wiki');
|
|
|
|
describe('unit test lib/scratch-wiki.js', () => {
|
|
test('getScratchWikiLink exists', () => {
|
|
expect(typeof getScratchWikiLink).toBe('function');
|
|
});
|
|
|
|
test('it returns link to jawiki when ja is given', () => {
|
|
expect(getScratchWikiLink('ja')).toBe('https://ja.scratch-wiki.info/');
|
|
});
|
|
|
|
test('it returns link to jawiki when ja-Hira is given', () => {
|
|
expect(getScratchWikiLink('ja-Hira')).toBe('https://ja.scratch-wiki.info/');
|
|
});
|
|
|
|
test('it returns link to enwiki when invalid locale is given', () => {
|
|
expect(getScratchWikiLink('test')).toBe('https://en.scratch-wiki.info/');
|
|
});
|
|
});
|