TESTS: moar tests...

This commit is contained in:
walljm 2017-01-16 21:36:22 -05:00
parent edf6475e6a
commit 7ce775059f
9 changed files with 893 additions and 647 deletions

View File

@ -36,3 +36,4 @@ DynamicBibleIonic/platforms/android/build.gradle
DynamicBibleIonic/platforms/android/android.json
DynamicBibleIonic/platforms/android/AndroidManifest.xml
DynamicBibleIonic/platforms/android/.gitignore
DynamicBibleIonic/.idea

View File

@ -268,8 +268,10 @@ describe('Reference', () => {
for (let i = 1; i <= book.lastchapter; i++)
expect(new Reference(bk.abbr + ' ' + i).toString()).toBe(bk.actual + ' ' + i + ":1 - *");
for (let i = 1; i < book.lastchapter; i++)
expect(new Reference(bk.abbr + ' ' + i+'-'+(i+1)).toString()).toBe(bk.actual + ' ' + i + ":1 - "+(i+1)+":*");
for (let i = 1; i < book.lastchapter; i++) {
expect(new Reference(bk.abbr + ' ' + i + '-' + (i + 1)).toString()).toBe(bk.actual + ' ' + i + ":1 - " + (i + 1) + ":*");
expect(new Reference(bk.abbr + ' ' + i + ':3-' + (i + 1)+":6").toString()).toBe(bk.actual + ' ' + i + ":3 - " + (i + 1) + ":6");
}
expect(new Reference(bk.abbr + ' 1:4-2:5').toString()).toBe(bk.actual + ' 1:4 - 2:5');
expect(new Reference(bk.abbr + ' 1:1 - 5').toString()).toBe(bk.actual + ' 1:1 - 5');

View File

@ -42,7 +42,7 @@ export class MyApp
openPage(page)
{
// close the menu when clicking a link from the menu
this.menu.close();
this.menu.close();
// navigate to the new page if it is not the current page
this.nav.setRoot(page.component);
}

View File

@ -9,12 +9,12 @@ import { MyApp } from './app.component';
import {SearchPage} from "../pages/search/search";
import {SettingsPage} from "../pages/settings/settings";
import {ComponentLoader} from "../components/component-loader/component-loader.ts";
import {Passage} from "../components/passage/passage.ts";
import {Strongs} from "../components/strongs/strongs.ts";
import {Words} from "../components/words/words.ts";
import {Error} from "../components/error/error.ts";
import {StrongsModal} from "../components/strongs-modal/strongs-modal.ts";
import {ComponentLoader} from "../components/component-loader/component-loader";
import {Passage} from "../components/passage/passage";
import {Strongs} from "../components/strongs/strongs";
import {Words} from "../components/words/words";
import {Error} from "../components/error/error";
import {StrongsModal} from "../components/strongs-modal/strongs-modal";
@NgModule({
declarations: [

View File

@ -66,4 +66,247 @@ describe('Bible Service', () => {
expect(r.testament).toBe('');
});
let booknames = [
{ "abbr": "gen", "actual": "Genesis" },
{ "abbr": "ge", "actual": "Genesis" },
{ "abbr": "genesis", "actual": "Genesis" },
{ "abbr": "gn", "actual": "Genesis" },
{ "abbr": "exodus", "actual": "Exodus" },
{ "abbr": "ex", "actual": "Exodus" },
{ "abbr": "exo", "actual": "Exodus" },
{ "abbr": "exod", "actual": "Exodus" },
{ "abbr": "exd", "actual": "Exodus" },
{ "abbr": "leviticus", "actual": "Leviticus" },
{ "abbr": "lev", "actual": "Leviticus" },
{ "abbr": "le", "actual": "Leviticus" },
{ "abbr": "levi", "actual": "Leviticus" },
{ "abbr": "lv", "actual": "Leviticus" },
{ "abbr": "numbers", "actual": "Numbers" },
{ "abbr": "num", "actual": "Numbers" },
{ "abbr": "nu", "actual": "Numbers" },
{ "abbr": "numb", "actual": "Numbers" },
{ "abbr": "number", "actual": "Numbers" },
{ "abbr": "deuteronomy", "actual": "Deuteronomy" },
{ "abbr": "deut", "actual": "Deuteronomy" },
{ "abbr": "de", "actual": "Deuteronomy" },
{ "abbr": "dt", "actual": "Deuteronomy" },
{ "abbr": "deu", "actual": "Deuteronomy" },
{ "abbr": "joshua", "actual": "Joshua" },
{ "abbr": "josh", "actual": "Joshua" },
{ "abbr": "jos", "actual": "Joshua" },
{ "abbr": "judges", "actual": "Judges" },
{ "abbr": "jud", "actual": "Judges" },
{ "abbr": "jdg", "actual": "Judges" },
{ "abbr": "judg", "actual": "Judges" },
{ "abbr": "ruth", "actual": "Ruth" },
{ "abbr": "ru", "actual": "Ruth" },
{ "abbr": "1 samuel", "actual": "1 Samuel" },
{ "abbr": "1 sa", "actual": "1 Samuel" },
{ "abbr": "1 sam", "actual": "1 Samuel" },
{ "abbr": "1 sml", "actual": "1 Samuel" },
{ "abbr": "i samuel", "actual": "1 Samuel" },
{ "abbr": "i sa", "actual": "1 Samuel" },
{ "abbr": "i sam", "actual": "1 Samuel" },
{ "abbr": "i sml", "actual": "1 Samuel" },
{ "abbr": "1st samuel", "actual": "1 Samuel" },
{ "abbr": "1st sa", "actual": "1 Samuel" },
{ "abbr": "1st sam", "actual": "1 Samuel" },
{ "abbr": "1st sml", "actual": "1 Samuel" },
{ "abbr": "first samuel", "actual": "1 Samuel" },
{ "abbr": "first sa", "actual": "1 Samuel" },
{ "abbr": "first sam", "actual": "1 Samuel" },
{ "abbr": "first sml", "actual": "1 Samuel" },
{ "abbr": "2 samuel", "actual": "2 Samuel" },
{ "abbr": "2 sa", "actual": "2 Samuel" },
{ "abbr": "2 sam", "actual": "2 Samuel" },
{ "abbr": "2 sml", "actual": "2 Samuel" },
{ "abbr": "ii samuel", "actual": "2 Samuel" },
{ "abbr": "ii sa", "actual": "2 Samuel" },
{ "abbr": "ii sam", "actual": "2 Samuel" },
{ "abbr": "ii sml", "actual": "2 Samuel" },
{ "abbr": "2nd samuel", "actual": "2 Samuel" },
{ "abbr": "2nd sa", "actual": "2 Samuel" },
{ "abbr": "2nd sam", "actual": "2 Samuel" },
{ "abbr": "2nd sml", "actual": "2 Samuel" },
{ "abbr": "second samuel", "actual": "2 Samuel" },
{ "abbr": "second sa", "actual": "2 Samuel" },
{ "abbr": "second sam", "actual": "2 Samuel" },
{ "abbr": "second sml", "actual": "2 Samuel" },
{ "abbr": "sec samuel", "actual": "2 Samuel" },
{ "abbr": "sec sa", "actual": "2 Samuel" },
{ "abbr": "sec sam", "actual": "2 Samuel" },
{ "abbr": "sec sml", "actual": "2 Samuel" },
{ "abbr": "1 kings", "actual": "1 Kings" },
{ "abbr": "1 king", "actual": "1 Kings" },
{ "abbr": "1 kgs", "actual": "1 Kings" },
{ "abbr": "1 kn", "actual": "1 Kings" },
{ "abbr": "1 k", "actual": "1 Kings" },
{ "abbr": "1 ki", "actual": "1 Kings" },
{ "abbr": "i kings", "actual": "1 Kings" },
{ "abbr": "i king", "actual": "1 Kings" },
{ "abbr": "i kgs", "actual": "1 Kings" },
{ "abbr": "i kn", "actual": "1 Kings" },
{ "abbr": "i k", "actual": "1 Kings" },
{ "abbr": "i ki", "actual": "1 Kings" },
{ "abbr": "1st kings", "actual": "1 Kings" },
{ "abbr": "1st king", "actual": "1 Kings" },
{ "abbr": "1st kgs", "actual": "1 Kings" },
{ "abbr": "1st kn", "actual": "1 Kings" },
{ "abbr": "1st k", "actual": "1 Kings" },
{ "abbr": "1st ki", "actual": "1 Kings" },
{ "abbr": "first kings", "actual": "1 Kings" },
{ "abbr": "first king", "actual": "1 Kings" },
{ "abbr": "first kgs", "actual": "1 Kings" },
{ "abbr": "first kn", "actual": "1 Kings" },
{ "abbr": "first k", "actual": "1 Kings" },
{ "abbr": "first ki", "actual": "1 Kings" },
{ "abbr": "2 Kings", "actual": "2 Kings" },
{ "abbr": "2 king", "actual": "2 Kings" },
{ "abbr": "2 kgs", "actual": "2 Kings" },
{ "abbr": "2 kn", "actual": "2 Kings" },
{ "abbr": "2 k", "actual": "2 Kings" },
{ "abbr": "2 ki", "actual": "2 Kings" },
{ "abbr": "ii kings", "actual": "2 Kings" },
{ "abbr": "ii king", "actual": "2 Kings" },
{ "abbr": "ii kgs", "actual": "2 Kings" },
{ "abbr": "ii kn", "actual": "2 Kings" },
{ "abbr": "ii k", "actual": "2 Kings" },
{ "abbr": "ii ki", "actual": "2 Kings" },
{ "abbr": "2nd kings", "actual": "2 Kings" },
{ "abbr": "2nd king", "actual": "2 Kings" },
{ "abbr": "2nd kgs", "actual": "2 Kings" },
{ "abbr": "2nd kn", "actual": "2 Kings" },
{ "abbr": "2nd k", "actual": "2 Kings" },
{ "abbr": "2nd ki", "actual": "2 Kings" },
{ "abbr": "second kings", "actual": "2 Kings" },
{ "abbr": "second king", "actual": "2 Kings" },
{ "abbr": "second kgs", "actual": "2 Kings" },
{ "abbr": "second kn", "actual": "2 Kings" },
{ "abbr": "second k", "actual": "2 Kings" },
{ "abbr": "second ki", "actual": "2 Kings" },
{ "abbr": "sec kings", "actual": "2 Kings" },
{ "abbr": "sec king", "actual": "2 Kings" },
{ "abbr": "sec kgs", "actual": "2 Kings" },
{ "abbr": "sec kn", "actual": "2 Kings" },
{ "abbr": "sec k", "actual": "2 Kings" },
{ "abbr": "sec ki", "actual": "2 Kings" },
{ "abbr": "2 Chronicles", "actual": "2 Chronicles" },
{ "abbr": "2 chronicles", "actual": "2 Chronicles" },
{ "abbr": "2 chron", "actual": "2 Chronicles" },
{ "abbr": "2 ch", "actual": "2 Chronicles" },
{ "abbr": "2 chr", "actual": "2 Chronicles" },
{ "abbr": "ii Chronicles", "actual": "2 Chronicles" },
{ "abbr": "ii chronicles", "actual": "2 Chronicles" },
{ "abbr": "ii chron", "actual": "2 Chronicles" },
{ "abbr": "ii ch", "actual": "2 Chronicles" },
{ "abbr": "ii chr", "actual": "2 Chronicles" },
{ "abbr": "2nd Chronicles", "actual": "2 Chronicles" },
{ "abbr": "2nd chronicles", "actual": "2 Chronicles" },
{ "abbr": "2nd chron", "actual": "2 Chronicles" },
{ "abbr": "2nd ch", "actual": "2 Chronicles" },
{ "abbr": "2nd chr", "actual": "2 Chronicles" },
{ "abbr": "second Chronicles", "actual": "2 Chronicles" },
{ "abbr": "second chronicles", "actual": "2 Chronicles" },
{ "abbr": "second chron", "actual": "2 Chronicles" },
{ "abbr": "second ch", "actual": "2 Chronicles" },
{ "abbr": "second chr", "actual": "2 Chronicles" },
{ "abbr": "sec Chronicles", "actual": "2 Chronicles" },
{ "abbr": "sec chronicles", "actual": "2 Chronicles" },
{ "abbr": "sec chron", "actual": "2 Chronicles" },
{ "abbr": "sec ch", "actual": "2 Chronicles" },
{ "abbr": "sec chr", "actual": "2 Chronicles" },
{ "abbr": "1 Chronicles", "actual": "1 Chronicles" },
{ "abbr": "1 chronicles", "actual": "1 Chronicles" },
{ "abbr": "1 chron", "actual": "1 Chronicles" },
{ "abbr": "1 ch", "actual": "1 Chronicles" },
{ "abbr": "1 chr", "actual": "1 Chronicles" },
{ "abbr": "i Chronicles", "actual": "1 Chronicles" },
{ "abbr": "i chronicles", "actual": "1 Chronicles" },
{ "abbr": "i chron", "actual": "1 Chronicles" },
{ "abbr": "i ch", "actual": "1 Chronicles" },
{ "abbr": "i chr", "actual": "1 Chronicles" },
{ "abbr": "1st Chronicles", "actual": "1 Chronicles" },
{ "abbr": "1st chronicles", "actual": "1 Chronicles" },
{ "abbr": "1st chron", "actual": "1 Chronicles" },
{ "abbr": "1st ch", "actual": "1 Chronicles" },
{ "abbr": "1st chr", "actual": "1 Chronicles" },
{ "abbr": "first Chronicles", "actual": "1 Chronicles" },
{ "abbr": "first chronicles", "actual": "1 Chronicles" },
{ "abbr": "first chron", "actual": "1 Chronicles" },
{ "abbr": "first ch", "actual": "1 Chronicles" },
{ "abbr": "first chr", "actual": "1 Chronicles" },
{ "abbr": "ezra", "actual": "Ezra" },
{ "abbr": "ezr", "actual": "Ezra" },
{ "abbr": "nehemiah", "actual": "Nehemiah" },
{ "abbr": "neh", "actual": "Nehemiah" },
{ "abbr": "ne", "actual": "Nehemiah" },
{ "abbr": "nehamiah", "actual": "Nehemiah" },
{ "abbr": "esther", "actual": "Esther" },
{ "abbr": "est", "actual": "Esther" },
{ "abbr": "es", "actual": "Esther" },
{ "abbr": "esth", "actual": "Esther" },
{ "abbr": "job", "actual": "Job" },
{ "abbr": "jo", "actual": "Job" },
{ "abbr": "jb", "actual": "Job" },
{ "abbr": "psalms", "actual": "Psalm" },
{ "abbr": "ps", "actual": "Psalm" },
{ "abbr": "psa", "actual": "Psalm" },
{ "abbr": "psalm", "actual": "Psalm" },
{ "abbr": "psm", "actual": "Psalm" },
{ "abbr": "proverbs", "actual": "Proverbs" },
{ "abbr": "prov", "actual": "Proverbs" },
{ "abbr": "pr", "actual": "Proverbs" },
{ "abbr": "pro", "actual": "Proverbs" },
{ "abbr": "proverb", "actual": "Proverbs" },
{ "abbr": "prv", "actual": "Proverbs" },
{ "abbr": "prvbs", "actual": "Proverbs" },
{ "abbr": "ecclesiastes", "actual": "Ecclesiastes" },
{ "abbr": "eccl", "actual": "Ecclesiastes" },
{ "abbr": "ecc", "actual": "Ecclesiastes" },
{ "abbr": "eccles", "actual": "Ecclesiastes" },
{ "abbr": "ec", "actual": "Ecclesiastes" },
{ "abbr": "ecl", "actual": "Ecclesiastes" },
{ "abbr": "ecclesiaste", "actual": "Ecclesiastes" },
{ "abbr": "song of solomon", "actual": "Song of Solomon" },
{ "abbr": "song of songs", "actual": "Song of Solomon" },
{ "abbr": "sos", "actual": "Song of Solomon" },
{ "abbr": "ss", "actual": "Song of Solomon" },
{ "abbr": "son", "actual": "Song of Solomon" },
{ "abbr": "so", "actual": "Song of Solomon" },
{ "abbr": "song", "actual": "Song of Solomon" },
{ "abbr": "songs", "actual": "Song of Solomon" },
{ "abbr": "isaiah", "actual": "Isaiah" },
{ "abbr": "is", "actual": "Isaiah" },
{ "abbr": "isah", "actual": "Isaiah" },
{ "abbr": "isai", "actual": "Isaiah" },
{ "abbr": "ia", "actual": "Isaiah" },
{ "abbr": "jerimiah", "actual": "Jeremiah" },
{ "abbr": "jeremiah", "actual": "Jeremiah" },
{ "abbr": "jer", "actual": "Jeremiah" },
{ "abbr": "je", "actual": "Jeremiah" },
{ "abbr": "jere", "actual": "Jeremiah" },
{ "abbr": "lamentations", "actual": "Lamentations" },
{ "abbr": "lam", "actual": "Lamentations" },
{ "abbr": "la", "actual": "Lamentations" },
{ "abbr": "lamentation", "actual": "Lamentations" },
];
for (let bk of booknames) {
it('Get Data for: ' + bk.abbr, () => {
let svc: BibleService = getTestBed().get(BibleService);
let book = Reference.parseBook(bk.abbr);
for (let i = 1; i <= book.lastchapter; i++)
{
let ref = new Reference(bk.abbr + " "+i).Section;
var r = svc.getResult(ref);
expect(r.msg).toBe(':)');
expect(r.ref).toBe(book.bookname + " "+i+":1 - *");
expect(r.status).toBe(0);
expect(r.cs[0].vss.length).toBeGreaterThan(1);
}
});
}
});

View File

@ -1,6 +1,6 @@
import { EventEmitter, Component, Output } from "@angular/core";
import { Platform, NavParams, ViewController } from 'ionic-angular';
import { Reference } from '../../Reference.ts';
import { Reference } from '../../Reference';
@Component({
selector: "strongs-modal",

View File

@ -1,5 +1,5 @@
import { EventEmitter, Component, Input, Output } from "@angular/core";
import { Reference } from '../../Reference.ts';
import { Reference } from '../../Reference';
@Component({
selector: "strongs",

View File

@ -1,5 +1,5 @@
import {EventEmitter, Component, Input, Output} from "@angular/core";
import { Reference } from '../../Reference.ts';
import { Reference } from '../../Reference';
@Component({
selector: "words",

View File

@ -5,7 +5,7 @@ import {BibleService} from "../../bible-service";
import {Loading, LoadingController, ModalController } from "ionic-angular";
import {StrongsService} from "../../strongs-service";
import {WordService} from "../../word-service";
import {StrongsModal} from "../../components/strongs-modal/strongs-modal.ts";
import {StrongsModal} from "../../components/strongs-modal/strongs-modal";
import {Storage} from '@ionic/storage';
import {UserProfile} from '../../UserProfile';