Skip to content

Commit

Permalink
Update JS assets, history view
Browse files Browse the repository at this point in the history
  • Loading branch information
joepio committed Jun 27, 2023
1 parent f5af18d commit d1f1c3c
Show file tree
Hide file tree
Showing 7 changed files with 183 additions and 145 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ See [STATUS.md](server/STATUS.md) to learn more about which features will remain
- Add support for Bearer token authentication, find in `/app/token` #632
- Add a `query` endpoint that allows peroforming collection queries via an enpoint instead of repurposing the collections collection.
- `resource.destroy` now recursively destroys its children.
- Update JS assets, add History view

## [v0.34.2] - 2023-03-04

Expand Down
280 changes: 140 additions & 140 deletions server/app_assets/assets/index.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion server/app_assets/assets/index.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion server/app_assets/assets/index2.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion server/app_assets/sw.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion server/app_assets/sw.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

39 changes: 38 additions & 1 deletion server/e2e_tests/e2e-generated.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -620,6 +620,38 @@ test.describe('data-browser', async () => {
),
);
});

test('history page', async ({ page }) => {
await signIn(page);
await newDrive(page);
// Create new class from new resource menu
await newResource('document', page);

// commit for saving initial document
await page.waitForResponse(`${serverUrl}/commit`);
// commit for initializing the first element (paragraph)
await page.waitForResponse(`${serverUrl}/commit`);

await editTitle('First Title', page);
expect(page.locator('text=First Title')).toBeVisible();

await editTitle('Second Title', page, true);
expect(page.locator('text=Second Title')).toBeVisible();

await contextMenuClick('history', page);
expect(page.locator('text=History of Second Title')).toBeVisible();

await page.getByTestId('version-button').nth(1).click();

expect(page.locator('text=First Title')).toBeVisible();

await page.click('text=Make current version');

expect(page.locator('text=Resource version updated')).toBeVisible();
await page.waitForNavigation();
expect(page.locator('h1:has-text("First Title")')).toBeVisible();
expect(page.locator('text=History of First Title')).not.toBeVisible();
});
});

async function disableViewTransition(page: Page) {
Expand Down Expand Up @@ -743,8 +775,13 @@ async function changeDrive(subject: string, page: Page) {
await expect(page.locator('text=Create new resource')).toBeVisible();
}

async function editTitle(title: string, page: Page) {
async function editTitle(title: string, page: Page, clear = false) {
await page.locator(editableTitle).click();

if (clear) {
await page.locator(editableTitle).clear();
}

// These keys make sure the onChange handler is properly called
await page.keyboard.press('Space');
await page.keyboard.press('Backspace');
Expand Down

0 comments on commit d1f1c3c

Please sign in to comment.