-
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.
- Loading branch information
Showing
4 changed files
with
53 additions
and
34 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
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,33 +1,45 @@ | ||
import { RatingsApi } from "cwmsjs"; | ||
import fetch from 'node-fetch'; | ||
import { RatingsApi, Configuration } from "cwmsjs"; | ||
import fetch from "node-fetch"; | ||
global.fetch = fetch; | ||
|
||
test('Test Ratings', async () => { | ||
const r_api = new RatingsApi() | ||
r_api.getCwmsDataRatings({ | ||
"office": "SWT" | ||
}).then((data) => { | ||
expect(data).toBeDefined() | ||
}) | ||
// Fetch the CWMS Rating specification for the SWT OFFICE given a rating mask for keystone lake | ||
r_api.getCwmsDataRatingsSpec({ | ||
"office": "SWT", | ||
"ratingIdMask": "KEYS.*" | ||
}).then((data) => { | ||
expect(data?.specs).toBeDefined() | ||
}) | ||
// Fetch the CWMS Rating templates for the SPK OFFICE | ||
r_api.getCwmsDataRatingsTemplate({ | ||
"office": "SPK" | ||
}).then((data) => { | ||
expect(data?.templates).toBeDefined() | ||
}) | ||
test("Test Ratings", async () => { | ||
const config_v2 = new Configuration({ | ||
headers: { | ||
accept: "application/json;version=2", | ||
}, | ||
}); | ||
const r_api = new RatingsApi(config_v2); | ||
await r_api | ||
.getCwmsDataRatings({ | ||
office: "SWT", | ||
}) | ||
.then((data) => { | ||
expect(data).toBeDefined(); | ||
}); | ||
// Fetch the CWMS Rating specification for the SWT OFFICE given a rating mask for keystone lake | ||
await r_api | ||
.getCwmsDataRatingsSpec({ | ||
office: "SWT", | ||
ratingIdMask: "KEYS.*", | ||
}) | ||
.then((data) => { | ||
expect(data?.specs).toBeDefined(); | ||
}); | ||
// Fetch the CWMS Rating templates for the SPK OFFICE | ||
await r_api | ||
.getCwmsDataRatingsTemplate({ | ||
office: "SPK", | ||
}) | ||
.then((data) => { | ||
expect(data?.templates).toBeDefined(); | ||
}); | ||
|
||
r_api.getCwmsDataRatingsTemplateWithTemplateId({ | ||
"office": "SWT", | ||
"templateId": "Elev-Alt;Stor-Alt.Linear" | ||
}).then(data=> { | ||
expect(data).toBeDefined() | ||
}) | ||
|
||
}, 30000) | ||
// await r_api | ||
// .getCwmsDataRatingsTemplateWithTemplateId({ | ||
// office: "SWT", | ||
// templateId: "Elev-Alt;Stor-Alt.Linear", | ||
// }) | ||
// .then((data) => { | ||
// expect(data).toBeDefined(); | ||
// }); | ||
}, 30000); |
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