Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,24 @@ fixture`Ai Column.Adaptivity`

const DATA_GRID_SELECTOR = '#container';

const resolveAIRequest = ClientFunction((): void => {
const { aiResponseData } = (window as any);
const { aiResolve } = (window as any);

if (aiResponseData && aiResolve) {
aiResolve(aiResponseData);

(window as any).aiResponseData = null;
(window as any).aiResolve = null;
}
});
const resolveAIRequest = ClientFunction((): Promise<void> => new Promise<void>((resolve) => {
const tryResolve = (): void => {
const { aiResponseData } = (window as any);
const { aiResolve } = (window as any);
if (aiResponseData && aiResolve) {
aiResolve(aiResponseData);

(window as any).aiResponseData = null;
(window as any).aiResolve = null;

resolve();
} else {
setTimeout(tryResolve, 50);
}
};
Comment thread
Raushen marked this conversation as resolved.
Outdated

tryResolve();
}));

const deleteGlobalVariables = ClientFunction((): void => {
delete (window as any).aiResponseData;
Expand Down Expand Up @@ -150,12 +157,12 @@ test('The AI column should not be hidden when there is a second AI column with a

test('The AI column should have value in the adaptive detail row', async (t) => {
const dataGrid = new DataGrid(DATA_GRID_SELECTOR);
await t.expect(dataGrid.isReady()).ok();

// act
await resolveAIRequest();

// assert
await t.expect(dataGrid.isReady()).ok();

const adaptiveButton = dataGrid.getAdaptiveButton();
Comment thread
Raushen marked this conversation as resolved.

Expand Down
Loading