Repository navigation
test: cover rtl:/ltr: variants in both directions - #472
Open
Abdalkaderdev wants to merge 1 commit into
Open
Abdalkaderdev wants to merge 1 commit into
Abdalkaderdev wants to merge 1 commit into
Conversation
nativewind#453 reports that the rtl: and ltr: variants are dropped, because lightningcss downcompiles :dir() to :lang() and the selector builder had no lang handler. It does not reproduce on main any more. There was no coverage to keep it that way: the existing ltr: test only asserts the default direction and never sets I18nManager.isRTL, so it passes whether or not the condition is honoured. These set isRTL both ways and assert the negative case too.
This branch has not been deployed
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Refs #453.
I went to fix #453 and could not reproduce it on
main—rtl:text-whiteapplies only whenI18nManager.isRTLis true, andltr:only when it is false. Something between the report in July and now already handles the:lang()form lightningcss downcompiles:dir()into.What was missing is coverage to keep it that way. The existing
ltr:test renders with the default direction and never touchesI18nManager.isRTL, so it would still pass if the condition were dropped entirely and the style applied unconditionally — which is exactly the failure mode in #453. There was nortl:test at all.These set
isRTLboth ways and assert the negative case, restoring the original descriptor afterwards so the mock cannot leak into other tests in the file.Tests only, no production change. The 4 failures in
src/__tests__/babelare present on a clean checkout ofmainand unrelated.