fun copyFromAttrsBuilderCopiesCorrectly()

in html/core/src/jsTest/kotlin/elements/AttributesTests.kt [153:184]


    fun copyFromAttrsBuilderCopiesCorrectly() {
        val attrsScopeCopyFrom = AttrsScopeBuilder<HTMLElement>().apply {
            id("id1")
            classes("a b c")
            attr("title", "customTitle")

            prop<HTMLElement, String>({ _, _ -> }, "Value")

            ref { onDispose { } }
            style {
                width(500.px)
                backgroundColor(Color.red)
            }

            onClick { }
            onFocusIn { }
            onMouseEnter { }
        }

        val copyToAttrsScope = AttrsScopeBuilder<HTMLElement>().apply {
            copyFrom(attrsScopeCopyFrom)
        }

        assertEquals(attrsScopeCopyFrom.attributesMap, copyToAttrsScope.attributesMap)
        assertEquals(attrsScopeCopyFrom.styleScope, copyToAttrsScope.styleScope)
        assertEquals(attrsScopeCopyFrom.refEffect, copyToAttrsScope.refEffect)
        assertEquals(attrsScopeCopyFrom.propertyUpdates, copyToAttrsScope.propertyUpdates)
        assertEquals(
            attrsScopeCopyFrom.eventsListenerScopeBuilder.collectListeners(),
            copyToAttrsScope.eventsListenerScopeBuilder.collectListeners()
        )
    }