-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test(toBeMultiPolygonGeometry): add robust snapshot tests
Adds extensive snapshot testing to address #32.
- Loading branch information
1 parent
1c9df69
commit df1c23a
Showing
2 changed files
with
118 additions
and
7 deletions.
There are no files selected for viewing
58 changes: 53 additions & 5 deletions
58
tests/geometries/__snapshots__/toBeMultiPolygonGeometry.test.js.snap
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,17 +1,65 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`Error Snapshot Testing. Throws error: expect({type: 'MultiPolygon', coordinates: [0,0,1,0,0,1,1,0,0,1,0,0]}).not.toBeMultiPolygonGeometry 1`] = ` | ||
"[2mexpect([22m[31mGeometryObject[39m[2m).not.toBeMultiPolygonGeometry()[22m | ||
exports[`Error Snapshot Testing. Throws error: Bounding box must be valid 1`] = ` | ||
"[2mexpect([22m[31mGeometryObject[39m[2m).toBeMultiPolygonGeometry()[22m | ||
Expected input to not be a valid GeoJSON MultiPolygon geometry. | ||
Bounding box must be an array of either four or six elments. | ||
Received: [31m{\\"coordinates\\": [[[[0, 0], [1, 0, 0], [1, 1, 0], [0, 1], [0, 0]]]], \\"type\\": \\"MultiPolygon\\"}[39m" | ||
Received: [31m{\\"bbox\\": [0], \\"coordinates\\": [[[[0, 0], [1, 0, 0], [1, 1, 0], [0, 1], [0, 0]]]], \\"type\\": \\"MultiPolygon\\"}[39m" | ||
`; | ||
|
||
exports[`Error Snapshot Testing. Throws error: Coordinates not an array 1`] = ` | ||
"[2mexpect([22m[31mGeometryObject[39m[2m).toBeMultiPolygonGeometry()[22m | ||
Coordinates property must be an array (appropriately structured by geometry type) with valid GeoJSON coordinates. | ||
Received: [31m{\\"coordinates\\": false, \\"type\\": \\"MultiPolygon\\"}[39m" | ||
`; | ||
|
||
exports[`Error Snapshot Testing. Throws error: Has forbidden property: features 1`] = ` | ||
"[2mexpect([22m[31mGeometryObject[39m[2m).toBeMultiPolygonGeometry()[22m | ||
GeoJSON Geometry objects are forbidden from having a property 'features'. | ||
Received: [31m{\\"coordinates\\": [[[[0, 0], [1, 0, 0], [1, 1, 0], [0, 1], [0, 0]]]], \\"features\\": null, \\"type\\": \\"MultiPolygon\\"}[39m" | ||
`; | ||
|
||
exports[`Error Snapshot Testing. Throws error: Has forbidden property: geometry 1`] = ` | ||
"[2mexpect([22m[31mGeometryObject[39m[2m).toBeMultiPolygonGeometry()[22m | ||
GeoJSON Geometry objects are forbidden from having a property 'geometry'. | ||
Received: [31m{\\"coordinates\\": [[[[0, 0], [1, 0, 0], [1, 1, 0], [0, 1], [0, 0]]]], \\"geometry\\": null, \\"type\\": \\"MultiPolygon\\"}[39m" | ||
`; | ||
|
||
exports[`Error Snapshot Testing. Throws error: expect(false).toBeMultiPolygonGeometry() 1`] = ` | ||
exports[`Error Snapshot Testing. Throws error: Has forbidden property: properties 1`] = ` | ||
"[2mexpect([22m[31mGeometryObject[39m[2m).toBeMultiPolygonGeometry()[22m | ||
GeoJSON Geometry objects are forbidden from having a property 'properties'. | ||
Received: [31m{\\"coordinates\\": [[[[0, 0], [1, 0, 0], [1, 1, 0], [0, 1], [0, 0]]]], \\"properties\\": null, \\"type\\": \\"MultiPolygon\\"}[39m" | ||
`; | ||
|
||
exports[`Error Snapshot Testing. Throws error: Invalid input to matcher 1`] = ` | ||
"[2mexpect([22m[31mGeometryObject[39m[2m).toBeMultiPolygonGeometry()[22m | ||
Must have a type property with value 'MultiPolygon'. | ||
Received: [31mfalse[39m" | ||
`; | ||
|
||
exports[`Error Snapshot Testing. Throws error: Missing coordinates property 1`] = ` | ||
"[2mexpect([22m[31mGeometryObject[39m[2m).toBeMultiPolygonGeometry()[22m | ||
GeoJSON Geometry objects (except GeometryCollection) must contain a 'coordinates' property. | ||
Received: [31m{\\"type\\": \\"MultiPolygon\\"}[39m" | ||
`; | ||
|
||
exports[`Error Snapshot Testing. Throws error: Valid use case passes 1`] = ` | ||
"[2mexpect([22m[31mGeometryObject[39m[2m).not.toBeMultiPolygonGeometry()[22m | ||
Expected input to not be a valid GeoJSON MultiPolygon geometry. | ||
Received: [31m{\\"coordinates\\": [[[[0, 0], [1, 0, 0], [1, 1, 0], [0, 1], [0, 0]]]], \\"type\\": \\"MultiPolygon\\"}[39m" | ||
`; |
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