fix tests

This commit is contained in:
Jason Wall 2020-11-27 17:29:08 -05:00
parent 2ff5279084
commit 4fbb7f601d

View File

@ -2,7 +2,7 @@ import { TestBed } from '@angular/core/testing';
import { reducer, getNewestStorable } from './app-state-reducer'; import { reducer, getNewestStorable } from './app-state-reducer';
import { AppActionFactory } from './app-state-actions'; import { AppActionFactory } from './app-state-actions';
import { Overlap } from '../common/bible-reference'; import { Overlap } from '../common/bible-reference';
import { Storable } from '../common/storable'; import { Storable, StorableType } from '../common/storable';
import { CardType, CardItem } from '../models/card-state'; import { CardType, CardItem } from '../models/card-state';
import { SavedPage } from '../models/page-state'; import { SavedPage } from '../models/page-state';
import { AppState, User } from '../models/app-state'; import { AppState, User } from '../models/app-state';
@ -14,11 +14,13 @@ describe('getNewestStorable', () => {
it('maybeMutateStorable', () => { it('maybeMutateStorable', () => {
const s1 = { const s1 = {
createdOn: new Date(2019, 1, 1, 0, 0, 0, 0).toISOString(), createdOn: new Date(2019, 1, 1, 0, 0, 0, 0).toISOString(),
type: StorableType.initial,
value: 'test1', value: 'test1',
}; };
const s2 = { const s2 = {
createdOn: new Date(2020, 1, 1, 0, 0, 0, 0).toISOString(), createdOn: new Date(2020, 1, 1, 0, 0, 0, 0).toISOString(),
type: StorableType.initial,
value: 'test1', value: 'test1',
}; };
@ -34,6 +36,7 @@ describe('AppService Reducer', () => {
user: null, user: null,
currentCards: { currentCards: {
createdOn: new Date(0).toISOString(), createdOn: new Date(0).toISOString(),
type: StorableType.initial,
value: [], value: [],
}, },
cardCache: {}, cardCache: {},
@ -45,6 +48,7 @@ describe('AppService Reducer', () => {
}, },
savedPages: { savedPages: {
createdOn: new Date(0).toISOString(), createdOn: new Date(0).toISOString(),
type: StorableType.initial,
value: [ value: [
{ {
queries: [ queries: [
@ -77,6 +81,7 @@ describe('AppService Reducer', () => {
}, },
notes: { notes: {
createdOn: new Date(0).toISOString(), createdOn: new Date(0).toISOString(),
type: StorableType.initial,
value: [], value: [],
}, },
savedPagesLoaded: false, savedPagesLoaded: false,
@ -84,6 +89,7 @@ describe('AppService Reducer', () => {
error: null, error: null,
settings: { settings: {
createdOn: new Date(0).toISOString(), createdOn: new Date(0).toISOString(),
type: StorableType.initial,
value: { value: {
displaySettings: { displaySettings: {
showStrongsAsModal: false, showStrongsAsModal: false,
@ -129,6 +135,7 @@ describe('AppService Reducer', () => {
it('UPDATE_SETTINGS', () => { it('UPDATE_SETTINGS', () => {
const settings = { const settings = {
createdOn: new Date(2020, 1, 1, 0, 0, 0, 0).toISOString(), createdOn: new Date(2020, 1, 1, 0, 0, 0, 0).toISOString(),
type: StorableType.initial,
value: { value: {
displaySettings: { displaySettings: {
showStrongsAsModal: true, showStrongsAsModal: true,
@ -339,6 +346,7 @@ describe('AppService Reducer', () => {
testState2, testState2,
AppActionFactory.newUpdateSettings({ AppActionFactory.newUpdateSettings({
createdOn: new Date(2020, 1, 1, 0, 0, 0, 0).toISOString(), createdOn: new Date(2020, 1, 1, 0, 0, 0, 0).toISOString(),
type: StorableType.initial,
value: { value: {
...testState2.settings.value, ...testState2.settings.value,
displaySettings: { displaySettings: {
@ -369,6 +377,7 @@ describe('AppService Reducer', () => {
testState2, testState2,
AppActionFactory.newUpdateSettings({ AppActionFactory.newUpdateSettings({
createdOn: new Date(2020, 1, 1, 0, 0, 0, 0).toISOString(), createdOn: new Date(2020, 1, 1, 0, 0, 0, 0).toISOString(),
type: StorableType.initial,
value: { value: {
...testState2.settings.value, ...testState2.settings.value,
displaySettings: { displaySettings: {
@ -399,6 +408,7 @@ describe('AppService Reducer', () => {
testState2, testState2,
AppActionFactory.newUpdateSettings({ AppActionFactory.newUpdateSettings({
createdOn: new Date(2020, 1, 1, 0, 0, 0, 0).toISOString(), createdOn: new Date(2020, 1, 1, 0, 0, 0, 0).toISOString(),
type: StorableType.initial,
value: { value: {
...testState2.settings.value, ...testState2.settings.value,
displaySettings: { displaySettings: {
@ -429,6 +439,7 @@ describe('AppService Reducer', () => {
testState2, testState2,
AppActionFactory.newUpdateSettings({ AppActionFactory.newUpdateSettings({
createdOn: new Date(2020, 1, 1, 0, 0, 0, 0).toISOString(), createdOn: new Date(2020, 1, 1, 0, 0, 0, 0).toISOString(),
type: StorableType.initial,
value: { value: {
...testState2.settings.value, ...testState2.settings.value,
displaySettings: { displaySettings: {