-
Notifications
You must be signed in to change notification settings - Fork 108
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed bug where .getDocuments and .query didn't return Document fields.
Closes #94 Added UnitTests to cover the above scenario. Added .gitattributes to handle line endings. Closes #93 Removed all GitHub domain prefixes on Markdown files. Enhances #92
- Loading branch information
1 parent
cc1be09
commit 3ab4ae3
Showing
6 changed files
with
35 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# Set the default behavior, in case people don't have core.autocrlf set. | ||
* text=auto | ||
|
||
# Files with crlf endings | ||
LICENSE text eol=crlf | ||
*.ts text eol=crlf | ||
*.json text eol=crlf | ||
*.md text eol=crlf | ||
*.yml text eol=crlf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
Hi! Thanks for creating a pull request. | ||
|
||
Please make sure you have read the [Contributing](https://github.com/grahamearley/FirestoreGoogleAppsScript/blob/main/.github/CONTRIBUTING.md) guidelines before submitting. | ||
Please make sure you have read the [Contributing](/grahamearley/FirestoreGoogleAppsScript/blob/main/.github/CONTRIBUTING.md) guidelines before submitting. | ||
|
||
(You can delete this text). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
function StoreCredentials_(): void { | ||
function StoreCredentials_(): void { | ||
/** DO NOT SAVE CREDENTIALS HERE */ | ||
const email = '[email protected]'; | ||
const key = '-----BEGIN PRIVATE KEY-----\nLine\nLine\n-----END PRIVATE KEY-----'; | ||
|
@@ -201,6 +201,14 @@ class Tests implements TestManager { | |
GSUnit.assertEquals(ids.length - 1, docs.length); | ||
} | ||
|
||
Test_Get_Documents_Content(): void { | ||
const path = 'Test Collection'; | ||
const ids = ['New Document !@#$%^&*(),.<>?;\':"[]{}|-=_+áéíóúæÆÑ']; | ||
const docs = this.db.getDocuments(path, ids); | ||
GSUnit.assertEquals(ids.length, docs.length); | ||
GSUnit.assertObjectEquals(this.expected_, docs[0].obj); | ||
} | ||
|
||
Test_Get_Documents_By_ID_Missing(): void { | ||
const path = 'Missing Collection'; | ||
const ids = [ | ||
|
@@ -250,6 +258,12 @@ class Tests implements TestManager { | |
GSUnit.assertArrayEquals(expected, docs); | ||
} | ||
|
||
Test_Query_One(): void { | ||
const path = 'Test Collection'; | ||
const docs = this.db.query(path).Where('null value', null).Execute(); | ||
GSUnit.assertObjectEquals(this.expected_, docs[0].obj); | ||
} | ||
|
||
Test_Query_Select_Name(): void { | ||
const path = 'Test Collection'; | ||
const docs = this.db.query(path).Select().Execute(); | ||
|