From 46dd3ce83cb793634b80882cb803b02a9974f106 Mon Sep 17 00:00:00 2001 From: Philip Cooksey Date: Sat, 11 Apr 2020 16:31:20 -0700 Subject: [PATCH] :rotating_light: Testing new bibtex_split_by attribute for selects The test adds onto a previous test and simple adds the values that should be generated from the keywords field with the ", " as the split attribute. I further cleaned up the test as the hard coded variables made upgrading the test harder than it should have been. --- test/test.js | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/test/test.js b/test/test.js index 37217b4..147db69 100644 --- a/test/test.js +++ b/test/test.js @@ -660,23 +660,24 @@ test ('Auto-Generated Select Contain Correct Information', async t => { const bibtexsearch = Selector('.bibtex_search'); - // Check the total count of display and entries - await t - .expect(bibtexsearch).ok() - .expect(bibtexsearch.count).eql(5); - // Authors, first authors, year, bibtexkey, bibtextypekey - var lengths = [6, 5, 5, 6, 4]; + var lengths = [6, 5, 5, 6, 4, 9]; var values = [ ["", "Tim Bloke", "Bob Last, Jr.", "Steven Man", "M. Night", "John Smith"], ["", "Bob Last, Jr.", "Steven Man", "M. Night", "John Smith"], ["", "1990", "2000", "2001", "2011"], ["", "article1", "article2", "book1", "book2", "proceedings1"], ["", "ARTICLE", "BOOK", "INPROCEEDINGS"], + ["", "Algorithm", "Chess", "Computer", "Democracy", "Politics", "Religion", "Society", "Supercomputer"], ]; + // Check the total count of display and entries + await t + .expect(bibtexsearch).ok() + .expect(bibtexsearch.count).eql(lengths.length); + // Loop over each select that was auto generated - for (var i = 0; i < 5; ++i) { + for (var i = 0; i < lengths.length; ++i) { var options = bibtexsearch.nth(i).find('option'); await t.expect(options.count).eql(lengths[i]); for (var j = 0; j < lengths[i]; ++j) {