paf31 / purescript-sdom

An experiment in replacing the virtual DOM and avoiding diffing

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How to test sdom applications?

Dierk opened this issue · comments

How would one pulp-test an sdom based application?
Can the examples show how to do this?

What sort of tests are you looking for? I think the usual UI testing techniques would work here.

it would be nice to test without the ui specifics, i.e. test the model update regardless of whether the event was triggered by a checkbox onclick or a textfield value change.
stimulus: trigger an event
assertion: validate that the model was updated as expected.

I think you could do this by testing the pure functions which update the model, right?

Well, testing the update function of the counter doesn't add information ;-) beside that testing leads to separate the function, which might been seen as an improvement.
Anyway, testing the model of the todo example could be interesting as it involves the context (and possibly the channel?).

I think this is probably out of scope for this library, honestly. I'm happy to see people fork this and go try some different approaches to testing, but I don't think I'd like to add anything specifically here. I'll close this for now, thanks.

fair enough :-)