fix(e2e): change the value of adminSchemaUid

This commit is contained in:
Zeke Zhang 2023-12-17 15:51:28 +08:00
parent 1cbdfa4f60
commit 1eee7f5f4e

View File

@ -435,18 +435,10 @@ const createPage = async (options?: CreatePageOptions) => {
}; };
const state = await api.storageState(); const state = await api.storageState();
const headers = getHeaders(state); const headers = getHeaders(state);
const systemSettings = await api.get(`/api/systemSettings:get/1`, {
headers,
});
const pageUid = uid(); const pageUid = uid();
const gridName = uid(); const gridName = uid();
if (systemSettings.ok()) { const result = await api.post(`/api/uiSchemas:insertAdjacent/nocobase-admin-menu?position=beforeEnd`, {
const { data } = await systemSettings.json();
const result = await api.post(`/api/uiSchemas:insertAdjacent/${data.options.adminSchemaUid}?position=beforeEnd`, {
headers, headers,
data: { data: {
schema: { schema: {
@ -492,9 +484,6 @@ const createPage = async (options?: CreatePageOptions) => {
if (!result.ok()) { if (!result.ok()) {
throw new Error(await result.text()); throw new Error(await result.text());
} }
} else {
throw new Error('systemSettings is not ok');
}
return pageUid; return pageUid;
}; };