mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2025-12-25 02:14:11 -05:00
feat(client): save challenge layout in local storage (again) (#55621)
This commit is contained in:
committed by
GitHub
parent
0eebe3ee2e
commit
cda00d4770
@@ -42,4 +42,34 @@ test.describe('MultifileEditor Component', () => {
|
||||
index++;
|
||||
}
|
||||
});
|
||||
|
||||
test('Reloading should preserve the editor layout', async ({
|
||||
page,
|
||||
isMobile
|
||||
}) => {
|
||||
test.skip(
|
||||
isMobile,
|
||||
'The mobile layout does not have resizable panes, so this test is not applicable.'
|
||||
);
|
||||
|
||||
const desktopLayout = page.getByTestId('desktop-layout');
|
||||
const splitter = desktopLayout.getByTestId('preview-left-splitter');
|
||||
const editorPane = desktopLayout.getByTestId('editor-pane');
|
||||
const initialStyle = await editorPane.getAttribute('style');
|
||||
expect(initialStyle).toContain('flex: 1');
|
||||
|
||||
// Drag the splitter to resize the editor pane
|
||||
await splitter.hover();
|
||||
await page.mouse.down();
|
||||
await page.mouse.move(100, 100);
|
||||
await page.mouse.up();
|
||||
|
||||
const newStyle = await editorPane.getAttribute('style');
|
||||
// It doesn't matter where it's dragged to, just that it's different:
|
||||
expect(newStyle).not.toContain('flex: 1');
|
||||
|
||||
await page.reload();
|
||||
|
||||
expect(await editorPane.getAttribute('style')).toBe(newStyle);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user