From 92624df1e0c0adc1a9cf1010e74b4f4376de78b0 Mon Sep 17 00:00:00 2001 From: tx3stn <14163530+tx3stn@users.noreply.github.com> Date: Sun, 16 Aug 2026 00:42:48 +0100 Subject: [PATCH 1/2] fix: remove duplicate tests and helpers causing compile error --- valdi/test/integration/Runtime_tests.cpp | 261 ----------------------- 1 file changed, 261 deletions(-) diff --git a/valdi/test/integration/Runtime_tests.cpp b/valdi/test/integration/Runtime_tests.cpp index 2c154546..e1302ad3 100644 --- a/valdi/test/integration/Runtime_tests.cpp +++ b/valdi/test/integration/Runtime_tests.cpp @@ -6719,267 +6719,6 @@ TEST_P(RuntimeFixture, inlineViewAttachmentSizeProviderTracksChildLayoutChanges) ASSERT_GT(labelView->getInvalidateLayoutCount(), invalidateLayoutCountBeforeSizeChange); } -static Ref getTextAttributeValueFromNode(ViewNode* viewNode) { - auto view = StandaloneView::unwrap(viewNode->getView()); - EXPECT_TRUE(view != nullptr); - if (view == nullptr) { - return nullptr; - } - - auto value = view->getAttribute(STRING_LITERAL("value")); - EXPECT_EQ(ValueType::ValdiObject, value.getType()); - auto attributedText = value.getTypedRef(); - EXPECT_TRUE(attributedText != nullptr); - return attributedText; -} - -static std::vector> getInlineViewAttachments(const Ref& attributedText) { - std::vector> attachments; - if (attributedText == nullptr) { - return attachments; - } - - for (size_t i = 0; i < attributedText->getPartsSize(); i++) { - const auto& attachment = attributedText->getStyleAtIndex(i).inlineViewAttachment; - if (attachment != nullptr) { - attachments.push_back(attachment); - } - } - return attachments; -} - -static Value inlineViewDynamicSizeViewModel(double width, double height) { - return Value().setMapValue("childWidth", Value(width)).setMapValue("childHeight", Value(height)); -} - -TEST_P(RuntimeFixture, supportsManagedChildFrameViewClasses) { - wrapper.standaloneRuntime->getViewManager().setManagesChildFramesForClass(STRING_LITERAL("ManagedChildFrameView"), - true); - - auto tree = wrapper.createViewNodeTreeAndContext( - STRING_LITERAL("ManagedChildFrames@test/src/ManagedChildFrames"), Value(), Value()); - - wrapper.waitUntilAllUpdatesCompleted(); - tree->setLayoutSpecs(Size(200, 200), LayoutDirectionLTR); - - auto managedNodes = findViewNodesWithId(tree->getRootViewNode(), "managed"); - auto childNodes = findViewNodesWithId(tree->getRootViewNode(), "managedChild"); - ASSERT_EQ(static_cast(1), managedNodes.size()); - ASSERT_EQ(static_cast(1), childNodes.size()); - - auto* managedNode = managedNodes[0]; - auto* childNode = childNodes[0]; - ASSERT_TRUE(managedNode->managesChildFrames()); - ASSERT_TRUE(childNode->parentManagesChildFrames()); - ASSERT_EQ(YGPositionTypeAbsolute, YGNodeStyleGetPositionType(childNode->getYogaNode())); - ASSERT_EQ(Frame(10, 0, 30, 20), childNode->getCalculatedFrame()); - - auto childView = StandaloneView::unwrap(childNode->getView()); - ASSERT_TRUE(childView != nullptr); - ASSERT_EQ(Frame(), childView->getFrame()); -} - -TEST_P(RuntimeFixture, resolvesInlineViewAttachmentsFromTextChildren) { - wrapper.standaloneRuntime->getViewManager().setManagesChildFramesForClass(STRING_LITERAL("SCValdiLabel"), true); - - auto tree = wrapper.createViewNodeTreeAndContext( - STRING_LITERAL("InlineViewTextAttribute@test/src/ManagedChildFrames"), Value(), Value()); - - wrapper.waitUntilAllUpdatesCompleted(); - tree->setLayoutSpecs(Size(200, 200), LayoutDirectionLTR); - - auto labelNodes = findViewNodesWithId(tree->getRootViewNode(), "inlineLabel"); - auto childNodes = findViewNodesWithId(tree->getRootViewNode(), "inlineChild"); - ASSERT_EQ(static_cast(1), labelNodes.size()); - ASSERT_EQ(static_cast(1), childNodes.size()); - - auto* labelNode = labelNodes[0]; - auto* childNode = childNodes[0]; - ASSERT_TRUE(labelNode->managesChildFrames()); - ASSERT_TRUE(childNode->parentManagesChildFrames()); - ASSERT_EQ(Frame(0, 0, 18, 12), childNode->getCalculatedFrame()); - - auto labelView = StandaloneView::unwrap(labelNode->getView()); - ASSERT_TRUE(labelView != nullptr); - - auto value = labelView->getAttribute(STRING_LITERAL("value")); - ASSERT_EQ(ValueType::ValdiObject, value.getType()); - - auto attributedText = value.getTypedRef(); - ASSERT_TRUE(attributedText != nullptr); - ASSERT_EQ(static_cast(3), attributedText->getPartsSize()); - ASSERT_EQ(STRING_LITERAL("Before "), attributedText->getContentAtIndex(0)); - ASSERT_EQ(STRING_LITERAL(" after"), attributedText->getContentAtIndex(2)); - - const auto& inlineStyle = attributedText->getStyleAtIndex(1); - ASSERT_TRUE(inlineStyle.inlineViewAttachment != nullptr); - ASSERT_EQ(static_cast(0), inlineStyle.inlineViewAttachment->getChildIndex()); - ASSERT_EQ(InlineViewVerticalAlignment::Bottom, inlineStyle.inlineViewAttachment->getVerticalAlignment()); - ASSERT_EQ(Size(18, 12), inlineStyle.inlineViewAttachment->getSize()); - - auto childView = StandaloneView::unwrap(childNode->getView()); - ASSERT_TRUE(childView != nullptr); - ASSERT_EQ(Frame(), childView->getFrame()); -} - -TEST_P(RuntimeFixture, resolvesInlineViewVerticalAlignmentEnumValuesFromTS) { - wrapper.standaloneRuntime->getViewManager().setManagesChildFramesForClass(STRING_LITERAL("SCValdiLabel"), true); - - auto tree = wrapper.createViewNodeTreeAndContext( - STRING_LITERAL("InlineViewVerticalAlignmentTextAttribute@test/src/ManagedChildFrames"), Value(), Value()); - - wrapper.waitUntilAllUpdatesCompleted(); - tree->setLayoutSpecs(Size(200, 200), LayoutDirectionLTR); - - auto labelNodes = findViewNodesWithId(tree->getRootViewNode(), "inlineLabel"); - auto topNodes = findViewNodesWithId(tree->getRootViewNode(), "inlineTop"); - auto centerNodes = findViewNodesWithId(tree->getRootViewNode(), "inlineCenter"); - auto bottomNodes = findViewNodesWithId(tree->getRootViewNode(), "inlineBottom"); - auto baselineNodes = findViewNodesWithId(tree->getRootViewNode(), "inlineBaseline"); - ASSERT_EQ(static_cast(1), labelNodes.size()); - ASSERT_EQ(static_cast(1), topNodes.size()); - ASSERT_EQ(static_cast(1), centerNodes.size()); - ASSERT_EQ(static_cast(1), bottomNodes.size()); - ASSERT_EQ(static_cast(1), baselineNodes.size()); - - auto* labelNode = labelNodes[0]; - ASSERT_TRUE(labelNode->managesChildFrames()); - ASSERT_TRUE(topNodes[0]->parentManagesChildFrames()); - ASSERT_TRUE(centerNodes[0]->parentManagesChildFrames()); - ASSERT_TRUE(bottomNodes[0]->parentManagesChildFrames()); - ASSERT_TRUE(baselineNodes[0]->parentManagesChildFrames()); - - ASSERT_EQ(Frame(0, 0, 11, 12), topNodes[0]->getCalculatedFrame()); - ASSERT_EQ(Frame(0, 0, 22, 24), centerNodes[0]->getCalculatedFrame()); - ASSERT_EQ(Frame(0, 0, 33, 36), bottomNodes[0]->getCalculatedFrame()); - ASSERT_EQ(Frame(0, 0, 44, 14), baselineNodes[0]->getCalculatedFrame()); - - auto attributedText = getTextAttributeValueFromNode(labelNode); - ASSERT_TRUE(attributedText != nullptr); - ASSERT_EQ(static_cast(9), attributedText->getPartsSize()); - ASSERT_EQ(STRING_LITERAL("A"), attributedText->getContentAtIndex(0)); - ASSERT_EQ(STRING_LITERAL("B"), attributedText->getContentAtIndex(2)); - ASSERT_EQ(STRING_LITERAL("C"), attributedText->getContentAtIndex(4)); - ASSERT_EQ(STRING_LITERAL("D"), attributedText->getContentAtIndex(6)); - ASSERT_EQ(STRING_LITERAL("E"), attributedText->getContentAtIndex(8)); - - auto attachments = getInlineViewAttachments(attributedText); - ASSERT_EQ(static_cast(4), attachments.size()); - ASSERT_EQ(static_cast(0), attachments[0]->getChildIndex()); - ASSERT_EQ(InlineViewVerticalAlignment::Top, attachments[0]->getVerticalAlignment()); - ASSERT_EQ(Size(11, 12), attachments[0]->getSize()); - ASSERT_EQ(static_cast(1), attachments[1]->getChildIndex()); - ASSERT_EQ(InlineViewVerticalAlignment::Center, attachments[1]->getVerticalAlignment()); - ASSERT_EQ(Size(22, 24), attachments[1]->getSize()); - ASSERT_EQ(static_cast(2), attachments[2]->getChildIndex()); - ASSERT_EQ(InlineViewVerticalAlignment::Bottom, attachments[2]->getVerticalAlignment()); - ASSERT_EQ(Size(33, 36), attachments[2]->getSize()); - ASSERT_EQ(static_cast(3), attachments[3]->getChildIndex()); - ASSERT_EQ(InlineViewVerticalAlignment::Baseline, attachments[3]->getVerticalAlignment()); - ASSERT_EQ(Size(44, 14), attachments[3]->getSize()); -} - -TEST_P(RuntimeFixture, resolvesInlineViewAttachmentsForTextViewChildren) { - wrapper.standaloneRuntime->getViewManager().setManagesChildFramesForClass(STRING_LITERAL("SCValdiTextView"), true); - - auto tree = wrapper.createViewNodeTreeAndContext( - STRING_LITERAL("InlineViewTextViewAttribute@test/src/ManagedChildFrames"), Value(), Value()); - - wrapper.waitUntilAllUpdatesCompleted(); - tree->setLayoutSpecs(Size(200, 200), LayoutDirectionLTR); - - auto textViewNodes = findViewNodesWithId(tree->getRootViewNode(), "inlineTextView"); - auto childNodes = findViewNodesWithId(tree->getRootViewNode(), "textViewInlineChild"); - ASSERT_EQ(static_cast(1), textViewNodes.size()); - ASSERT_EQ(static_cast(1), childNodes.size()); - - auto* textViewNode = textViewNodes[0]; - auto* childNode = childNodes[0]; - ASSERT_TRUE(textViewNode->managesChildFrames()); - ASSERT_TRUE(childNode->parentManagesChildFrames()); - ASSERT_EQ(YGPositionTypeAbsolute, YGNodeStyleGetPositionType(childNode->getYogaNode())); - ASSERT_EQ(Frame(0, 0, 26, 16), childNode->getCalculatedFrame()); - - auto attributedText = getTextAttributeValueFromNode(textViewNode); - auto attachments = getInlineViewAttachments(attributedText); - ASSERT_EQ(static_cast(1), attachments.size()); - ASSERT_EQ(static_cast(0), attachments[0]->getChildIndex()); - ASSERT_EQ(InlineViewVerticalAlignment::Top, attachments[0]->getVerticalAlignment()); - ASSERT_EQ(Size(26, 16), attachments[0]->getSize()); - - auto childView = StandaloneView::unwrap(childNode->getView()); - ASSERT_TRUE(childView != nullptr); - ASSERT_EQ(Frame(), childView->getFrame()); -} - -TEST_P(RuntimeFixture, rejectsInvalidInlineViewChildIndexesFromTSAttributedText) { - wrapper.standaloneRuntime->getViewManager().setManagesChildFramesForClass(STRING_LITERAL("SCValdiLabel"), true); - - auto tree = wrapper.createViewNodeTreeAndContext( - STRING_LITERAL("InlineViewInvalidChildIndexAttribute@test/src/ManagedChildFrames"), Value(), Value()); - - wrapper.waitUntilAllUpdatesCompleted(); - tree->setLayoutSpecs(Size(200, 200), LayoutDirectionLTR); - - auto labelNodes = findViewNodesWithId(tree->getRootViewNode(), "inlineLabel"); - auto childNodes = findViewNodesWithId(tree->getRootViewNode(), "inlineChild"); - ASSERT_EQ(static_cast(1), labelNodes.size()); - ASSERT_EQ(static_cast(1), childNodes.size()); - ASSERT_TRUE(labelNodes[0]->managesChildFrames()); - ASSERT_TRUE(childNodes[0]->parentManagesChildFrames()); - - auto labelView = StandaloneView::unwrap(labelNodes[0]->getView()); - ASSERT_TRUE(labelView != nullptr); - ASSERT_TRUE(labelView->getAttribute(STRING_LITERAL("value")).isUndefined()); -} - -TEST_P(RuntimeFixture, inlineViewAttachmentSizeProviderTracksChildLayoutChanges) { - wrapper.standaloneRuntime->getViewManager().setManagesChildFramesForClass(STRING_LITERAL("SCValdiLabel"), true); - - auto tree = wrapper.createViewNodeTreeAndContext( - STRING_LITERAL("InlineViewDynamicSizeAttribute@test/src/ManagedChildFrames"), - inlineViewDynamicSizeViewModel(18, 12), - Value()); - - wrapper.waitUntilAllUpdatesCompleted(); - tree->setLayoutSpecs(Size(200, 200), LayoutDirectionLTR); - - auto labelNodes = findViewNodesWithId(tree->getRootViewNode(), "inlineLabel"); - auto childNodes = findViewNodesWithId(tree->getRootViewNode(), "inlineChild"); - ASSERT_EQ(static_cast(1), labelNodes.size()); - ASSERT_EQ(static_cast(1), childNodes.size()); - ASSERT_EQ(Frame(0, 0, 18, 12), childNodes[0]->getCalculatedFrame()); - - auto attributedText = getTextAttributeValueFromNode(labelNodes[0]); - auto attachments = getInlineViewAttachments(attributedText); - ASSERT_EQ(static_cast(1), attachments.size()); - auto attachment = attachments[0]; - ASSERT_EQ(Size(18, 12), attachment->getSize()); - - auto labelView = StandaloneView::unwrap(labelNodes[0]->getView()); - ASSERT_TRUE(labelView != nullptr); - auto invalidateLayoutCountBeforeSizeChange = labelView->getInvalidateLayoutCount(); - - wrapper.setViewModel(tree->getContext(), inlineViewDynamicSizeViewModel(31, 17)); - wrapper.waitUntilAllUpdatesCompleted(); - - ASSERT_EQ(Frame(0, 0, 31, 17), childNodes[0]->getCalculatedFrame()); - ASSERT_EQ(Size(31, 17), attachment->getSize()); - - tree->setLayoutSpecs(Size(200, 200), LayoutDirectionLTR); - - auto updatedChildNodes = findViewNodesWithId(tree->getRootViewNode(), "inlineChild"); - ASSERT_EQ(static_cast(1), updatedChildNodes.size()); - ASSERT_EQ(Frame(0, 0, 31, 17), updatedChildNodes[0]->getCalculatedFrame()); - ASSERT_EQ(Size(31, 17), attachment->getSize()); - - auto updatedAttributedText = getTextAttributeValueFromNode(labelNodes[0]); - auto updatedAttachments = getInlineViewAttachments(updatedAttributedText); - ASSERT_EQ(static_cast(1), updatedAttachments.size()); - ASSERT_EQ(Size(31, 17), updatedAttachments[0]->getSize()); - ASSERT_GT(labelView->getInvalidateLayoutCount(), invalidateLayoutCountBeforeSizeChange); -} - TEST_P(RuntimeFixture, supportsAccesibilityValueInTextAttribute) { auto tree = wrapper.createViewNodeTreeAndContext(STRING_LITERAL("TextAttribute@test/src/TextAttribute"), Value(), Value()); From 5fd14d15c2b289af403c9cbe794c9d9c8de090eb Mon Sep 17 00:00:00 2001 From: tx3stn <14163530+tx3stn@users.noreply.github.com> Date: Sun, 16 Aug 2026 11:38:13 +0100 Subject: [PATCH 2/2] fix: valdi_web integration tests fail in CI --- tools/valdi_web_devtools/test_utils/test_runner.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tools/valdi_web_devtools/test_utils/test_runner.js b/tools/valdi_web_devtools/test_utils/test_runner.js index 80efd10c..8af37241 100644 --- a/tools/valdi_web_devtools/test_utils/test_runner.js +++ b/tools/valdi_web_devtools/test_utils/test_runner.js @@ -56,6 +56,9 @@ function run(config) { '--testMatch', '**/tests/**/*.integration.test.js', '--runInBand', '--verbose', + '--watchman=false', + '--haste', + '{"enableSymlinks":true}', ], { cwd: process.cwd(), env: { ...process.env, PUPPETEER_EXECUTABLE_PATH: chromePath, BASE_URL: `http://localhost:${port}` },