Conversation
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com> Co-authored-by: Tihomir Ivanov <tihomir@devlings.dev>
…l.ts (#6734) Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
- Added src/parse/index.test.ts with 3 unit tests covering error
recovery in the MDX parser (type: 'mdx' path):
- JSX child expression inside a registered component (<Cta>{name}</Cta>)
produces invalid_markdown
- Malformed/truncated tag (<Cta) produces invalid_markdown
- Serializing an invalid_markdown node roundtrips back to the original
string (no data loss on save)
Closes #6467. ### 🧪 Test coverage summary | Test Area | New tests | Describe block | |-----------|-----------|----------------| | 1. Request construction and dispatching | **3** | `request() — wire format` | | 2. Branch resolution and management | **10** | `branch resolution` (5) + `branch management` (5) | | 3. Error handling | **5** | `request() — error handling` | | 4. Auth token flow | **3** | `auth token flow` | | 5. `isLocalMode` detection (extended) | **2** | `LocalClient — default wiring` | | **Total** | **23 new** | across 5 new `describe` blocks | ### 📝 New tests **`LocalClient — default wiring`** - `defaults to the local dev server URL when no customContentApiUrl is provided` - `uses a LocalAuthProvider by default` **`request() — wire format`** - `sends a POST with JSON content-type to the branch-derived content API URL` - `stringifies the query and variables into the request body` - `prints a graphql-tag function into the body's query string` **`branch resolution`** - `encodes the branch into the content API URL` - `re-derives the content API URL when setBranch is called` - `prefers customContentApiUrl over the branch-derived URL` - `applies tinaioConfig.contentApiUrlOverride to the base URL` - `promotes schema.config.contentApiUrlOverride to the content API URL` **`branch management`** - `createBranch sends a POST with baseBranch and branchName in the JSON body` - `createBranch returns the branch name parsed from the response ref` - `createBranch throws with the response body message when the response is not ok` - `listBranches GETs the list_branches endpoint and parses the response through the zod schema` - `branchExists returns true in local mode without calling listBranches` **`request() — error handling`** - `throws with clientId and branch context on a non-200 against a tina.io URL` - `omits the clientId/branch hint when a custom content API URL is set` - `appends the response body's message to the thrown error` - `joins GraphQL error messages from a 200 response` - `propagates a fetch rejection unchanged` **`auth token flow`** - `includes an Authorization Bearer header when getToken returns an id_token` - `omits the Authorization header when getToken returns null` - `fetches a fresh token for each request` ### ✅ Verification From `packages/tinacms/`: ```sh pnpm test ``` 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Ivan Gaiduk <ivangaiduk@ssw.com.au>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
See Commits and Changes for more details.
Created by
pull[bot] (v2.0.0-alpha.4)
Can you help keep this open source service alive? 💖 Please sponsor : )