Has anyone built test fixtures for a slot based ap...
# compose
m
Has anyone built test fixtures for a slot based api with optional slots? I have a slot based api that has 4 slots, 3 of which are optional. Those slots go into a Row. I'm not trying to create a test fixture for this, but the issue i'm having is if i add test tags, i would end up drastically altering the semantic tree, as i'd have to start inserting boxes and other things. This is an existing API where the slot functions have scoping (RowScope, BoxScope, etc..), so altering the semantic tree would also affect the api. That i really need is some form of node that can be left out of the merged tree, but not affect the actual layouts.
Copy code
Row(
        modifier = modifier,
        verticalAlignment = Alignment.CenterVertically
    ) {
        leadingContent?.let { lc ->
            lc()
            Spacer(modifier = Modifier.width(LineItemInnerPadding))
        }

        Box(modifier = Modifier.weight(weight = 1f, fill = true)) {
            content()
        }

        statusContent?.let { sc ->
            Spacer(modifier = Modifier.width(LineItemInnerPadding))
            sc()
        }

        trailingContent?.let { tc ->
            Spacer(modifier = Modifier.width(LineItemInnerPaddingMedium))
            tc()
        }
    }