Skip to content

test(behavior): cover style-cascade bidiVisual round-trip preservation (SD-3171)#3356

Merged
caio-pizzol merged 2 commits into
mainfrom
caio-pizzol/SD-3171-roundtrip-coverage
May 17, 2026
Merged

test(behavior): cover style-cascade bidiVisual round-trip preservation (SD-3171)#3356
caio-pizzol merged 2 commits into
mainfrom
caio-pizzol/SD-3171-roundtrip-coverage

Conversation

@caio-pizzol
Copy link
Copy Markdown
Contributor

SD-3171 (#3354) narrowed what visualDirection consults to inline-only. The fix didn't say anything about whether the importer/exporter still preserves a style-cascade w:bidiVisual in the exported XML. A future commit that "cleans up" the unused property could silently strip it from the style definition; renders would still pass (because we no longer read it), but round-trip integrity would be gone and a Word user opening the re-exported file would lose the property.

This test pins both halves of the contract:

  • Re-importing the exported file still renders A B C (the fix holds).
  • The exported XML still contains w:bidiVisual in the style or document parts (the property survives export).

Verified 3/3 browsers green locally (chromium, firefox, webkit).

…(SD-3171)

The SD-3171 fix in #3354 narrowed what visualDirection consults to inline-only,
but said nothing about whether the importer/exporter still preserves a
style-cascade w:bidiVisual in the exported XML. A future commit that "cleans
up" the unused property could silently strip it from the style definition;
renders would still pass (because we no longer read it), but round-trip
integrity would be gone and a Word user opening the re-exported file would
lose the property.

This test pins both halves of the contract:

  1. Re-importing the exported file still renders A B C (the fix holds).
  2. The exported XML still contains a w:bidiVisual element somewhere in the
     style or document parts (the property survives export).

Verified 3/3 browsers green (chromium, firefox, webkit).
@caio-pizzol caio-pizzol requested a review from a team as a code owner May 17, 2026 10:54
@linear-code
Copy link
Copy Markdown

linear-code Bot commented May 17, 2026

SD-3171

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: c9c5f0c0e9

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread tests/behavior/tests/tables/rtl-style-derived-bidivisual-roundtrip.spec.ts Outdated
@codecov-commenter
Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

… style

Per Codex review on #3356: the loose substring check
(documentXml.includes('w:bidiVisual') || stylesXml.includes(...)) passes even
if export strips the style's true `w:bidiVisual` and emits an explicit-false
`<w:bidiVisual w:val="0"/>` inline. Re-import would still render A B C
(explicit-false produces no flip), so the test would pass while the property
was silently lost from the style entry the fixture set it on.

Tighten the assertion to parse the `RtlStyleTable` style block in
word/styles.xml, locate `w:bidiVisual` inside its `w:tblPr`, and validate the
boolean per OOXML §17.17.4 (truthy = no `w:val`, or `w:val` in
{"1","true","on"}). The inline fallback is dropped because the contract is
specifically about preserving the property on the style cascade.
@caio-pizzol caio-pizzol merged commit 2b4e9a1 into main May 17, 2026
27 of 29 checks passed
@caio-pizzol caio-pizzol deleted the caio-pizzol/SD-3171-roundtrip-coverage branch May 17, 2026 13:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants