decaporg / decaporg/decap-cms

Tests: Add more complex e2e tests

Open
#3,373 5 comments 1 reaction 0 assignees View on GitHub
area: testing pinned
Dominant language
JavaScript
Stars
19.4k
Forks
3.1k
Avg merge
1d 14h
Merged PRs (30d)
9

Description

Context https://github.com/netlify/netlify-cms/issues/3332, https://github.com/netlify/netlify-cms/issues/3372 and https://github.com/netlify/netlify-cms/pull/3411

We've had several cases in the past when having out of dirty repos/out of sync forks will cause issues for editorial workflow and open authoring.

### Editorial Workflow Examples

1. Updating a PR that has an [empty commit](https://github.com/netlify/netlify-cms/pull/3411). We'll probably need to create an empty commit via GitHub API.
2. Updating a PR that had been [edited manually via GitHub](https://github.com/netlify/netlify-cms/pull/3403), specifically added media files that are not mapped to fields.
3. Update an existing entry in editorial workflow mode when that entry branch already exists.

### Open Authoring Examples

Example scenario:
1. Create a test repo with open authoring enabled.
2. Login with a GitHub user that doesn't have access to the repo.
3. Fork the repo via the CMS.
4. Simulate an out of date fork by reverting a bunch of commits and force pushing an out of date default branch.
5. Create an entry via the fork and move to `Review`.
6. Verify the created PR.

Another example for https://github.com/netlify/netlify-cms/issues/3372:
1. Create a test repo with open authoring enabled.
2. Login with a GitHub user that doesn't have access to the repo.
3. Fork the repo via the CMS.
4. Simulate an out of date fork by reverting a bunch of commits and force pushing an out of date default branch.
5. Reload the CMS and see that it offers the user to sync the fork.
6. Sync the fork via the CMS.
7. Validate success.

Another scenario (https://github.com/netlify/netlify-cms/issues/3506):
1. Create a test repo with open authoring enabled.
2. Login with a GitHub user that doesn't have access to the repo.
3. Fork the repo via the CMS.
4. Create a new entry.
5. Move entry to `In Review`.
6. Merge entry via GitHub API
7. See that entry disappears for open authoring user and branch is deleted.
8. Edit the same entry and repeat steps 5-7.

Repeat scenario for both merge commits, squash commits and rebase commits.

We should also test when the sync should fail (e.g. unresolved conflicts).

Contributor guide

Open the contributing guide

Research direction

Start by reviewing linked issues #3332, #3372, and #3506, along with pull requests #3411 and #3403, to understand the reported repository and fork states. Add end-to-end coverage for the listed editorial and open-authoring scenarios, including merge commit variants and failed syncs with unresolved conflicts; no file or existing test entry point is named.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
testing
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.