babylonlabs-io / simple-staking

Other
6 stars 6 forks source link

E2E Text constants #136

Open gbarkhatov opened 3 weeks ago

gbarkhatov commented 3 weeks ago

We use some inline text: I certify that I have read, I acknowledge that Keystone via QR code, Connect to BTC network, or even Staking Dashboard as the page name. We need to extract these as constants and use both in:

So these 2 consume the stuff from one place

graph TD
    A[Text Constants] --> B[App]
    A[Text Constants] --> C[E2E Tests]
gbarkhatov commented 1 week ago

@vitsalis do we want our app to consume text constants or do we just want to extract needed text to e2e text constants?

i.e. this:

graph TD
    A[Text Constants] --> B[App]
    A[Text Constants] --> C[E2E Tests]

or this

graph TD
    A[App]
    B[Text Constants] --> C[E2E Tests]

2nd approach is related to E2E only 1st approach will involve extraction of the needed (by E2E tests) labels to a file, then both app and e2e will consume the stuff from one place. Other application labels/texts (not touched by e2e) will not be extracted

vitsalis commented 1 week ago

I think the first option will be much easier to maintain, as if we update the text, we can be confident that both the app and e2e tests will receive the updates. Might make the code a bit more unreadable though as the text will not be directly visible.