Skip to content

Commit

Permalink
[botcom] stub more end to end tests (tldraw#4844)
Browse files Browse the repository at this point in the history
This PR stubs a few more end to end tests as todos.

### Change type

- [ ] `bugfix`
- [ ] `improvement`
- [ ] `feature`
- [ ] `api`
- [x] `other`
  • Loading branch information
steveruizok authored Nov 3, 2024
1 parent c69f187 commit b7e3f2c
Show file tree
Hide file tree
Showing 5 changed files with 73 additions and 1 deletion.
1 change: 1 addition & 0 deletions apps/dotcom/client/e2e/fixtures/tla-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,5 @@ export const test = base.extend<TlaFixtures>({
testUse(new ShareMenu(page))
},
})

export { expect } from '@playwright/test'
1 change: 1 addition & 0 deletions apps/dotcom/client/e2e/tests/database.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { expect, test } from '../fixtures/tla-test'

test.beforeEach(async ({ homePage }) => {
await homePage.goto()
await homePage.isLoaded()
Expand Down
32 changes: 31 additions & 1 deletion apps/dotcom/client/e2e/tests/homepage.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,40 @@ test('can toggle sidebar', async ({ editor, sidebar }) => {
await expect(sidebar.sidebarLogo).toBeVisible()
})

test('can create new document', async ({ editor, sidebar }) => {
test('can create new file', async ({ editor, sidebar }) => {
await editor.ensureSidebarOpen()
const currentCount = await sidebar.getNumberOfFiles()
await sidebar.createNewDocument()
const newCount = await sidebar.getNumberOfFiles()
expect(newCount).toBe(currentCount + 1)
})

test.fixme('can can double click file name to rename it', async () => {
// ...
})

// Preferences

test.fixme('can toggle dark mode', async () => {
// ...
})

// File menu in sidebar

test.fixme('can duplicate a file', async () => {
// ...
})

test.fixme('can copy a file link from the file menu', async () => {
// ...
})

test.fixme('can delete a file', async () => {
// ...
})

// Menu bar

test.fixme('can rename a file name by clicking the name', async () => {
// ...
})
28 changes: 28 additions & 0 deletions apps/dotcom/client/e2e/tests/not-logged-in.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,31 @@ test('can login', async ({ homePage, editor }) => {
await expect(homePage.signInButton).not.toBeVisible()
await expect(editor.sidebarToggle).toBeVisible()
})

test.fixme('can visit a shared file', async () => {
// ...
})

test.fixme('can visit a pubished file', async () => {
// ...
})

test.fixme('can not visit an unshared file', async () => {
// ...
})

test.fixme('can scroll down to see landing page content', async () => {
// ...
})

test.fixme('can export images', async () => {
// ...
})

test.fixme('when visiting a shared file, can copy the shared file link', async () => {
// ...
})

test.fixme('when visiting a published file, can copy the published file link', async () => {
// ...
})
12 changes: 12 additions & 0 deletions apps/dotcom/client/e2e/tests/sharing.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ test.afterEach(async ({ database }) => {
await database.reset()
})

/* --------------------- Sharing -------------------- */

async function shareFileAndCopyLink(
page: Page,
shareMenu: ShareMenu,
Expand Down Expand Up @@ -47,6 +49,12 @@ test('can unshare a file', async ({ page, browser, shareMenu }) => {
await newContext.close()
})

test.fixme('can copy a shared file link', async () => {
// ...
})

/* ------------------- Publishing ------------------- */

test('can publish a file', async ({ page, browser, shareMenu }) => {
const url = await shareFileAndCopyLink(page, shareMenu, shareMenu.publishFile)
expect(url).toMatch(/http:\/\/localhost:3000\/q\/p\//)
Expand Down Expand Up @@ -98,3 +106,7 @@ test('can update published file', async ({ page, browser, editor, shareMenu }) =
expect(await newEditor.getNumberOfShapes()).toBe(2)
await newContext.close()
})

test.fixme('can copy a published file link', async () => {
// ...
})

0 comments on commit b7e3f2c

Please sign in to comment.