Skip to content

Commit

Permalink
🚨 Testing new bibtex_split_by attribute for selects
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
pcooksey committed Apr 11, 2020
1 parent 9034073 commit 46dd3ce
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions test/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 46dd3ce

Please sign in to comment.