paf31 / purescript-sdom

An experiment in replacing the virtual DOM and avoiding diffing
MIT License
161 stars 13 forks source link

How to test sdom applications? #10

Closed Dierk closed 6 years ago

Dierk commented 6 years ago

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

paf31 commented 6 years ago

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

Dierk commented 6 years ago

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.

paf31 commented 6 years ago

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

Dierk commented 6 years ago

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?).

paf31 commented 6 years ago

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.

Dierk commented 6 years ago

fair enough :-)