feat(core): init feature flag service (#7856)

This commit is contained in:
EYHN
2024-08-14 10:35:21 +00:00
parent 339c39c1ec
commit 0504d0b0ff
19 changed files with 361 additions and 312 deletions
+2 -31
View File
@@ -132,35 +132,7 @@ test('tab title will change when navigating', async ({ page }) => {
}
});
// temporary way to enable split view
async function enableSplitView(page: Page) {
await page.evaluate(() => {
const settingKey = 'affine-settings';
window.localStorage.setItem(
settingKey,
JSON.stringify({
clientBorder: false,
fullWidthLayout: false,
windowFrameStyle: 'frameless',
fontStyle: 'Serif',
dateFormat: 'MM/dd/YYYY',
startWeekOnMonday: false,
enableBlurBackground: true,
enableNoisyBackground: true,
autoCheckUpdate: true,
autoDownloadUpdate: true,
enableMultiView: true,
editorFlags: {},
})
);
});
await page.reload({
timeout: 30000,
});
}
test('open new tab via cmd+click page link', async ({ page }) => {
await enableSplitView(page);
await clickNewPageButton(page);
await page.waitForTimeout(500);
await page.keyboard.press('Enter');
@@ -177,7 +149,6 @@ test('open new tab via cmd+click page link', async ({ page }) => {
});
test('open split view', async ({ page }) => {
await enableSplitView(page);
await clickNewPageButton(page);
await page.waitForTimeout(500);
await page.keyboard.press('Enter');
@@ -229,10 +200,10 @@ test('reorder tabs', async ({ page }) => {
await createLinkedPage(page, titles[0]);
await createLinkedPage(page, titles[1]);
await page.locator(`.affine-reference-title:has-text("${titles[0]}")`).click({
modifiers: ['ControlOrMeta', 'Alt'],
modifiers: ['ControlOrMeta'],
});
await page.locator(`.affine-reference-title:has-text("${titles[1]}")`).click({
modifiers: ['ControlOrMeta', 'Alt'],
modifiers: ['ControlOrMeta'],
});
await expectTabTitle(page, 0, 'Untitled');