mirror of
https://github.com/JasonHHouse/gaps.git
synced 2026-01-06 02:50:20 -06:00
Merge remote-tracking branch 'origin/improvement/adding_jest' into improvement/adding_jest
This commit is contained in:
@@ -12,7 +12,9 @@
|
||||
/* global Handlebars, SockJS, Stomp */
|
||||
/* eslint no-undef: "error" */
|
||||
|
||||
import { getContextPath, getRecommendedMoviesForTable, getYear, isEqual, isNotOwned } from '../modules/common.min.js';
|
||||
import {
|
||||
getContextPath, getRecommendedMoviesForTable, getYear, isEqual, isNotOwned,
|
||||
} from '../modules/common.min.js';
|
||||
import Payload from '../modules/payload.min.js';
|
||||
|
||||
let libraryTitle;
|
||||
@@ -218,7 +220,4 @@ jQuery(($) => {
|
||||
window.copyToClipboard = copyToClipboard;
|
||||
});
|
||||
|
||||
window.onbeforeunload = function () {
|
||||
disconnect();
|
||||
// return false;
|
||||
};
|
||||
window.onbeforeunload = disconnect;
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
jest.mock('../__mocks__/getRecommendedMovies');
|
||||
import { getYear, isEqual, isNotOwned, getRecommendedMoviesForTable } from '../GapsWeb/src/main/resources/static/js/modules/common';
|
||||
/* global test, expect */
|
||||
|
||||
import {
|
||||
getYear, isEqual, isNotOwned,
|
||||
} from '../GapsWeb/src/main/resources/static/js/modules/common.js';
|
||||
|
||||
test('Checks for valid year', () => {
|
||||
expect(getYear(2005)).toBe(' (2005)');
|
||||
@@ -18,11 +21,11 @@ test('Checks for no year', () => {
|
||||
});
|
||||
|
||||
test('Two equal TMDB IDs', () => {
|
||||
expect(isEqual(1234567,1234567)).toBe(true);
|
||||
expect(isEqual(1234567, 1234567)).toBe(true);
|
||||
});
|
||||
|
||||
test('Two unequal TMDB IDs', () => {
|
||||
expect(isEqual(1234567,7654321)).toBe(false);
|
||||
expect(isEqual(1234567, 7654321)).toBe(false);
|
||||
});
|
||||
|
||||
test('Should be owned', () => {
|
||||
|
||||
Reference in New Issue
Block a user