Skip to content

Automated testing for modelValue and stateful prop #3834

Open
@asvae

Description

@asvae

Vuestic-ui version: 1.7.6

The issue is that sometimes stateful and modelValue become broken and it's hard for us to catch the regression. It's also pretty painful for users. Both are pretty implementation specific, so just moving the logic to polished composable and calling it a day won't work.

I suggest to have universal test for them (could be implemented either as a unit test or as a storybook wrapper).

Implementation

The way I see it, we would need 2 new public methods for every component, something like setModelState and getModelState. Then we would create tests as seen in image.

These methods would also be used internally in component, I.e. setModelState - would be used on interaction (i.e. checkbox click), and getModelState would fetch whichever value component displays currently.

image

Other

  • Probably could be applied to some other props, i.e. search value for select, but modelValue and stateful are key offenders, so we want to focus on them first.

Metadata

Metadata

Assignees

Labels

BUGSomething isn't workingd2: easyRecomended mode for new, but mature playersv3: wish to haveThis is something user want, but can live without it

Type

No type

Projects

Status

Backlog

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions