Skip to content

Commit

Permalink
Fix tests and update version number
Browse files Browse the repository at this point in the history
  • Loading branch information
RobH123 committed Oct 23, 2020
1 parent 3956c89 commit 2152419
Show file tree
Hide file tree
Showing 3 changed files with 53 additions and 5 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "uw-content-validation",
"description": "Functions for Checking Door43.org Scriptural Content/Resources.",
"version": "0.8.16_alpha6",
"version": "0.8.16",
"private": false,
"homepage": "https://unfoldingword.github.io/uw-content-validation/",
"repository": {
Expand Down
48 changes: 48 additions & 0 deletions src/__tests__/__snapshots__/tn-table-row-check.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,18 @@ Object {
exports[`checkTN_TSVDataRow() - Original Quote tests - should fail with leading word joiner 1`] = `
Object {
"noticeList": Array [
Object {
"C": "1",
"V": "2",
"bookID": "GEN",
"characterIndex": 0,
"extract": "‼וְ‼חֹ֖שֶׁ…",
"fieldName": "OrigQuote",
"location": " that was supplied",
"message": "Unexpected leading word joiner",
"priority": 770,
"rowID": "d7qw",
},
Object {
"C": "1",
"V": "2",
Expand Down Expand Up @@ -255,6 +267,18 @@ Object {
exports[`checkTN_TSVDataRow() - Original Quote tests - should fail with leading zero width joiner 1`] = `
Object {
"noticeList": Array [
Object {
"C": "1",
"V": "2",
"bookID": "GEN",
"characterIndex": 0,
"extract": "‼וְ⁠חֹ֖שֶׁ…",
"fieldName": "OrigQuote",
"location": " that was supplied",
"message": "Unexpected leading zero-width joiner",
"priority": 771,
"rowID": "d7qw",
},
Object {
"C": "1",
"V": "2",
Expand Down Expand Up @@ -390,6 +414,18 @@ Object {
exports[`checkTN_TSVDataRow() - Original Quote tests - should fail with trailing word joiner 1`] = `
Object {
"noticeList": Array [
Object {
"C": "1",
"V": "2",
"bookID": "GEN",
"characterIndex": 0,
"extract": "וְ‼חֹ֖שֶׁך…",
"fieldName": "OrigQuote",
"location": " that was supplied",
"message": "Unexpected trailing word joiner",
"priority": 772,
"rowID": "d7qw",
},
Object {
"C": "1",
"V": "2",
Expand Down Expand Up @@ -431,6 +467,18 @@ Object {
exports[`checkTN_TSVDataRow() - Original Quote tests - should fail with trailing zero width joiner 1`] = `
Object {
"noticeList": Array [
Object {
"C": "1",
"V": "2",
"bookID": "GEN",
"characterIndex": 0,
"extract": "וְ⁠חֹ֖שֶׁך…",
"fieldName": "OrigQuote",
"location": " that was supplied",
"message": "Unexpected trailing zero-width joiner",
"priority": 773,
"rowID": "d7qw",
},
Object {
"C": "1",
"V": "2",
Expand Down
8 changes: 4 additions & 4 deletions src/__tests__/tn-table-row-check.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -161,14 +161,14 @@ describe('checkTN_TSVDataRow() - ', () => {
it('should fail with leading word joiner', async() => {
const chosenLine = "GEN\t1\t2\td7qw\tfigs-imperative\t\u2060וְ⁠חֹ֖שֶׁךְ\t1\tDarkness\tThis is a command. By commanding that light should exist, God made it exist. (See: [[rc://*/ta/man/translate/figs-imperative]])";
const rawResults = await checkTN_TSVDataRow(languageCode, chosenLine, 'GEN','1','2', 'that was supplied', optionalCheckingOptions);
expect(rawResults.noticeList.length).toEqual(3);
expect(rawResults.noticeList.length).toEqual(4);
expect(rawResults).toMatchSnapshot();
});

it('should fail with trailing word joiner', async() => {
const chosenLine = "GEN\t1\t2\td7qw\tfigs-imperative\tוְ⁠חֹ֖שֶׁךְ\u2060\t1\tDarkness\tThis is a command. By commanding that light should exist, God made it exist. (See: [[rc://*/ta/man/translate/figs-imperative]])";
const rawResults = await checkTN_TSVDataRow(languageCode, chosenLine, 'GEN','1','2', 'that was supplied', optionalCheckingOptions);
expect(rawResults.noticeList.length).toEqual(3);
expect(rawResults.noticeList.length).toEqual(4);
expect(rawResults).toMatchSnapshot();
});

Expand All @@ -189,14 +189,14 @@ describe('checkTN_TSVDataRow() - ', () => {
it('should fail with leading zero width joiner', async() => {
const chosenLine = "GEN\t1\t2\td7qw\tfigs-imperative\t\u200dוְ⁠חֹ֖שֶׁךְ\t1\tDarkness\tThis is a command. By commanding that light should exist, God made it exist. (See: [[rc://*/ta/man/translate/figs-imperative]])";
const rawResults = await checkTN_TSVDataRow(languageCode, chosenLine, 'GEN','1','2', 'that was supplied', optionalCheckingOptions);
expect(rawResults.noticeList.length).toEqual(3);
expect(rawResults.noticeList.length).toEqual(4);
expect(rawResults).toMatchSnapshot();
});

it('should fail with trailing zero width joiner', async() => {
const chosenLine = "GEN\t1\t2\td7qw\tfigs-imperative\tוְ⁠חֹ֖שֶׁךְ\u200d\t1\tDarkness\tThis is a command. By commanding that light should exist, God made it exist. (See: [[rc://*/ta/man/translate/figs-imperative]])";
const rawResults = await checkTN_TSVDataRow(languageCode, chosenLine, 'GEN','1','2', 'that was supplied', optionalCheckingOptions);
expect(rawResults.noticeList.length).toEqual(3);
expect(rawResults.noticeList.length).toEqual(4);
expect(rawResults).toMatchSnapshot();
});

Expand Down

0 comments on commit 2152419

Please sign in to comment.