Skip to content

test(playwright): add basic tests for editor API - #8072

Merged
mejo- merged 6 commits into
mainfrom
test/editor_api_test
Dec 19, 2025
Merged

mejo- merged 6 commits into
mainfrom
test/editor_api_test

Conversation

@mejo-

@mejo- mejo- commented Dec 15, 2025

Copy link
Copy Markdown
Member

🏁 Checklist

  • Code is properly formatted (npm run lint / npm run stylelint / composer run cs:check)
  • Sign-off message is added to all commits
  • Tests (unit, integration and/or end-to-end) passing and the changes are covered with tests

@mejo- mejo- self-assigned this Dec 15, 2025
@mejo- mejo- added tests If you write them we ♥ you 3. to review labels Dec 15, 2025
@mejo-
mejo- force-pushed the test/editor_api_test branch from fcea4c9 to e5a8e45 Compare December 15, 2025 16:03
@codecov

codecov Bot commented Dec 15, 2025

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@max-nextcloud max-nextcloud left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All in all looks good. The create...Editor functions could be moved into fixtures for easier reuse. But we can also do that later, just need to make sure not to copy them anywhere else / rewrite them.

Comment thread playwright/e2e/editor-api.spec.ts Outdated
@mejo-
mejo- force-pushed the test/editor_api_test branch from e5a8e45 to ae3f0da Compare December 18, 2025 16:18
@mejo-

mejo- commented Dec 18, 2025

Copy link
Copy Markdown
Member Author

All in all looks good. The create...Editor functions could be moved into fixtures for easier reuse. But we can also do that later, just need to make sure not to copy them anywhere else / rewrite them.

That's a good point. I refactored the tests with help of copilot and think they're much cleaner structured now. Let me know what you think 😊

@mejo-
mejo- force-pushed the test/editor_api_test branch from ae3f0da to 253ee01 Compare December 18, 2025 16:22

@max-nextcloud max-nextcloud left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just some comments. I think the AI artifacts are showing. 😉

Comment thread playwright/support/fixtures/editor-api.ts Outdated
Comment thread playwright/support/fixtures/editor-api.ts Outdated
},
) => {
const containerId = options.containerId ?? 'test-editor-api'
const containerId = 'test-editor-api'

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're not using the containerId fixture from below. So I think you can either do away with it or add it above to the { page }.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see a reason to make it configurable. At the same time it needs to be exposed by the fixture as the tests need it in order to use it in CSS selectors.

Signed-off-by: Jonas <jonas@freesources.org>
Signed-off-by: Jonas <jonas@freesources.org>
Signed-off-by: Jonas <jonas@freesources.org>
…itor

Signed-off-by: Jonas <jonas@freesources.org>
@mejo-
mejo- force-pushed the test/editor_api_test branch from 253ee01 to 19c2ffb Compare December 19, 2025 07:54
…ions

Signed-off-by: Jonas <jonas@freesources.org>
@mejo-
mejo- merged commit e64f3c7 into main Dec 19, 2025
62 of 63 checks passed
@mejo-
mejo- deleted the test/editor_api_test branch December 19, 2025 08:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3. to review tests If you write them we ♥ you

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants