spanish-quizzer

An app to quiz you on Spanish vocabulary and verb conjugations
git clone https://git.ashermorgan.net/spanish-quizzer/
Log | Files | Refs | README

commit b2d0352275a0e9875a62316816eaec4f88ebb86a
parent c8e2e002f3763c325ad0415ca81dd63d2f359ce8
Author: AsherMorgan <59518073+AsherMorgan@users.noreply.github.com>
Date:   Fri, 26 Feb 2021 14:50:45 -0800

Add 1 filter to filters page by default

Diffstat:
Mjs/filtersPage.js | 4++--
Mtests/test.filtersPage.js | 17+++++++++++++----
2 files changed, 15 insertions(+), 6 deletions(-)

diff --git a/js/filtersPage.js b/js/filtersPage.js @@ -20,8 +20,8 @@ let filterInput = Vue.component("filterInput", { data: function() { return { - verbFilters: [], - vocabFilters: [], + verbFilters: [{tense:"All Tenses", type:"All Types", subject:"All Subjects", direction:"Eng. → Conj."}], + vocabFilters: [{category:"All Categories", type:"All Types", direction:"Eng. ↔ Esp."}], }; }, diff --git a/tests/test.filtersPage.js b/tests/test.filtersPage.js @@ -11,12 +11,16 @@ describe("FilterInput", function() { expect(FilterInput.category).to.equal("verbs"); }); - it("VerbFilters should be empty", function() { - expect(FilterInput.verbFilters.length).to.equal(0); + it("VerbFilters should be correct", function() { + expect(FilterInput.verbFilters).to.deep.equal([ + {tense:"All Tenses", type:"All Types", subject:"All Subjects", direction:"Eng. → Conj."} + ]); }); - it("VocabFilters should be empty", function() { - expect(FilterInput.vocabFilters.length).to.equal(0); + it("VocabFilters should be correct", function() { + expect(FilterInput.vocabFilters).to.deep.equal([ + {category:"All Categories", type:"All Types", direction:"Eng. ↔ Esp."} + ]); }); }); @@ -70,6 +74,8 @@ describe("FilterInput", function() { it("Should add a verb filter if category is 'verbs'", function() { // Initialize variables FilterInput.category = "verbs"; + FilterInput.verbFilters = [] + FilterInput.vocabFilters = [] expect(FilterInput.verbFilters.length).to.equal(0); expect(FilterInput.vocabFilters.length).to.equal(0); @@ -86,6 +92,8 @@ describe("FilterInput", function() { it("Should add a vocab filter if category is 'vocab'", function() { // Initialize variables FilterInput.category = "vocab"; + FilterInput.verbFilters = [] + FilterInput.vocabFilters = [] expect(FilterInput.verbFilters.length).to.equal(0); expect(FilterInput.vocabFilters.length).to.equal(0); @@ -443,6 +451,7 @@ describe("SettingsInput", function() { }); + // filters-page component describe("FiltersPage", function() { let FiltersPage;