@terreno/admin-frontend 0.17.0 → 0.18.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "dependencies": {
3
- "@terreno/ui": "0.17.0",
3
+ "@terreno/ui": "0.18.0",
4
4
  "expo-router": "~6.0.19",
5
5
  "jspdf": "^4.2.0",
6
6
  "lodash": "^4.17.23",
@@ -51,5 +51,5 @@
51
51
  "test:coverage": "bun run ../scripts/check-coverage.ts"
52
52
  },
53
53
  "types": "dist/index.d.ts",
54
- "version": "0.17.0"
54
+ "version": "0.18.0"
55
55
  }
@@ -131,4 +131,32 @@ describe("AdminModelList", () => {
131
131
  });
132
132
  expect(routerPush).toHaveBeenCalledWith("/admin/User");
133
133
  });
134
+
135
+ it("fetches config from apiBase but navigates using routeBase when split", async () => {
136
+ mockConfigState.data = {...baseConfig, customScreens: [], scripts: []};
137
+ const {getByLabelText} = renderWithTheme(
138
+ <AdminModelList api={{} as unknown as AdminApi} apiBase="/admin" routeBase="/console" />
139
+ );
140
+ // Data fetching must use the API base.
141
+ expect(configApiBaseCalls).toContain("/admin");
142
+ // Card press must navigate using the route base, not the API base.
143
+ await act(async () => {
144
+ fireEvent.press(getByLabelText("User"));
145
+ await new Promise((r) => setTimeout(r, 50));
146
+ });
147
+ expect(routerPush).toHaveBeenCalledWith("/console/User");
148
+ });
149
+
150
+ it("uses baseUrl for both fetching and navigation (backward compat)", async () => {
151
+ mockConfigState.data = {...baseConfig, customScreens: [], scripts: []};
152
+ const {getByLabelText} = renderWithTheme(
153
+ <AdminModelList api={{} as unknown as AdminApi} baseUrl="/admin" />
154
+ );
155
+ expect(configApiBaseCalls).toContain("/admin");
156
+ await act(async () => {
157
+ fireEvent.press(getByLabelText("User"));
158
+ await new Promise((r) => setTimeout(r, 50));
159
+ });
160
+ expect(routerPush).toHaveBeenCalledWith("/admin/User");
161
+ });
134
162
  });