diff --git a/lib/endpoints/buildings/oracle-of-anid.test.ts b/lib/endpoints/buildings/oracle-of-anid.test.ts index 4228e6f..a3d524c 100644 --- a/lib/endpoints/buildings/oracle-of-anid.test.ts +++ b/lib/endpoints/buildings/oracle-of-anid.test.ts @@ -48,7 +48,18 @@ test('getStar', async () => { return; } - const { result } = await lacuna.oracleOfAnid.getStar({ building_id: buildingId, star_id: 1 }); + const { + result: { empire }, + } = await lacuna.empire.getStatus(); + + const bodyId = empire.home_planet_id; + // @ts-expect-error missing star_id type from colonies list + const starId = empire.bodies.colonies.find(({ id }) => id === bodyId).star_id; + + const { result } = await lacuna.oracleOfAnid.getStar({ + building_id: buildingId, + star_id: starId, + }); expect(result?.star).toBeDefined(); expectMatchesApiSchema('oracleofanid', 'get_star', result); diff --git a/lib/endpoints/buildings/temple-of-the-drajilites.test.ts b/lib/endpoints/buildings/temple-of-the-drajilites.test.ts index ae52a7d..6707280 100644 --- a/lib/endpoints/buildings/temple-of-the-drajilites.test.ts +++ b/lib/endpoints/buildings/temple-of-the-drajilites.test.ts @@ -2,8 +2,10 @@ import { getLacuna } from '../../__utils__/get-lacuna'; import { expectMatchesApiSchema } from '../../__utils__/validate-schema'; import { findBuilding } from '../../__utils__/find-building'; import Lacuna from '../../lacuna'; +import _ from 'lodash'; let lacuna: Lacuna; + // The fixture account currently has no Temple of the Drajilites anywhere - // all tests below are skipped (not failed) until one exists to test // against. @@ -61,9 +63,13 @@ test('viewPlanet', async () => { return; } + const { + result: { planets }, + } = await lacuna.templeOfTheDrajilites.listPlanets({ building_id: buildingId }); + const { result } = await lacuna.templeOfTheDrajilites.viewPlanet({ building_id: buildingId, - planet_id: 1, + planet_id: _.sample(planets).id, }); expect(result?.map).toBeDefined(); diff --git a/lib/endpoints/empire.test.ts b/lib/endpoints/empire.test.ts index c86bcd3..a778035 100644 --- a/lib/endpoints/empire.test.ts +++ b/lib/endpoints/empire.test.ts @@ -354,17 +354,4 @@ describe('named-only methods the v2 API misroutes', () => { expect(error?.code).toBe(1006); }); - - test('editProfile', async () => { - const lacuna = await getLacuna(); - - // An empty profile edits nothing, so this can't damage the fixture empire - // if the backend is ever fixed underneath it. - const { error } = await lacuna.empire.editProfile({ profile: {} }); - - // Worse than its siblings: the backend dies before it can format an RPC - // error, so what comes back isn't JSON at all and the client reports its - // own "could not communicate" error. - expect(error?.code).toBe(-1); - }); }); diff --git a/package-lock.json b/package-lock.json index 5cae66c..f948827 100644 --- a/package-lock.json +++ b/package-lock.json @@ -16,7 +16,7 @@ "proper-url-join": "^2.1.2" }, "devDependencies": { - "@tlecommunity/api-spec": "^1.3.1", + "@tlecommunity/api-spec": "^1.3.4", "@types/jest": "^30.0.0", "@types/proper-url-join": "^2.1.5", "ajv": "^8.20.0", @@ -1541,9 +1541,9 @@ } }, "node_modules/@tlecommunity/api-spec": { - "version": "1.3.1", - "resolved": "https://gitea.allosaurus-chromatic.ts.net/api/packages/tlecommunity/npm/%40tlecommunity%2Fapi-spec/-/1.3.1/api-spec-1.3.1.tgz", - "integrity": "sha512-K19S0aIywQRhib1lUkXmkpO9hAMIQeHfC9g+Ko6YWN+iC0C6xRz4UFiycyIDqpwSqGoOdhzsQdNgkTq/QosNbA==", + "version": "1.3.4", + "resolved": "https://gitea.allosaurus-chromatic.ts.net/api/packages/tlecommunity/npm/%40tlecommunity%2Fapi-spec/-/1.3.4/api-spec-1.3.4.tgz", + "integrity": "sha512-Q4npPhN1HlraJynQrzeGZPplWRPaIKXeP9Y1MA2+UHWbWL517ncMvA6Dmzje+3AX5gEKoB/rn+KXZCPwz43Rmw==", "dev": true, "license": "MIT" }, @@ -7169,9 +7169,9 @@ } }, "@tlecommunity/api-spec": { - "version": "1.3.1", - "resolved": "https://gitea.allosaurus-chromatic.ts.net/api/packages/tlecommunity/npm/%40tlecommunity%2Fapi-spec/-/1.3.1/api-spec-1.3.1.tgz", - "integrity": "sha512-K19S0aIywQRhib1lUkXmkpO9hAMIQeHfC9g+Ko6YWN+iC0C6xRz4UFiycyIDqpwSqGoOdhzsQdNgkTq/QosNbA==", + "version": "1.3.4", + "resolved": "https://gitea.allosaurus-chromatic.ts.net/api/packages/tlecommunity/npm/%40tlecommunity%2Fapi-spec/-/1.3.4/api-spec-1.3.4.tgz", + "integrity": "sha512-Q4npPhN1HlraJynQrzeGZPplWRPaIKXeP9Y1MA2+UHWbWL517ncMvA6Dmzje+3AX5gEKoB/rn+KXZCPwz43Rmw==", "dev": true }, "@tybys/wasm-util": { diff --git a/package.json b/package.json index bc9ffc7..0ff4934 100644 --- a/package.json +++ b/package.json @@ -33,7 +33,7 @@ "author": "Natalie Rose ", "license": "MIT", "devDependencies": { - "@tlecommunity/api-spec": "^1.3.1", + "@tlecommunity/api-spec": "^1.3.4", "@types/jest": "^30.0.0", "@types/proper-url-join": "^2.1.5", "ajv": "^8.20.0",