Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: disposing unit should not emit error #2529

Merged
merged 13 commits into from
Jun 15, 2024
Next Next commit
ci: should throw no error on disposing unit
  • Loading branch information
wzhudev authored and ybzky committed Jun 15, 2024
commit 9b6d6f5d6250672f6ac5d3f685e781084400bfff
21 changes: 19 additions & 2 deletions e2e/disposing/disposing.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,27 @@ test('no error on constructing and disposing', async ({ page }) => {
await page.waitForTimeout(2000);

await page.evaluate(() => window.E2EControllerAPI.loadDefaultSheet());
await page.waitForTimeout(2000); // wait for long enough to let the GC do its job
await page.waitForTimeout(2000);

await page.evaluate(() => window.E2EControllerAPI.disposeUniver());
await page.waitForTimeout(2000); // wait for long enough to let the GC do its job
await page.waitForTimeout(2000);

expect(errored).toBeFalsy();
});

test('no error when dispose a unit', async ({ page }) => {
let errored = false;

page.on('pageerror', (error) => {
console.error('Page error:', error);
errored = true;
});

await page.goto('http:https://localhost:3000/sheets/');
await page.waitForTimeout(2000);

await page.evaluate(() => window.E2EControllerAPI.loadAndRelease(1));
await page.waitForTimeout(2000);

expect(errored).toBeFalsy();
});
1 change: 1 addition & 0 deletions e2e/memory/memory.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import { expect, test } from '@playwright/test';
// examples/src/plugins/debugger/controllers/e2e/e2e-memory.controller.ts
export interface IE2EControllerAPI {
loadAndRelease(id: number): Promise<void>;
loadDefaultSheet(): Promise<void>;
disposeUniver(): Promise<void>;
}

Expand Down
2 changes: 1 addition & 1 deletion packages/sheets-thread-comment/src/types/const.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@

export const SHEETS_THREAD_COMMENT_MODAL = 'univer.sheet.thread-comment-modal';
export const COMMENT_SINGLE_ICON = 'comment-single';
export const SHEETS_THREAD_COMMENT = 'univer.sheet.thread-comment';
export const SHEETS_THREAD_COMMENT = 'SHEET_THREAD_COMMENT';