Re: Snapshot testing for wicket?

2016-12-15 Thread Martin Grigorov
When Wicket was doing this the JS developers were dealing with Dojo 0.4 ;-)

See org.apache.wicket.util.tester.WicketTestCase#executeTest(java.lang.Class,
java.lang.String)
Example:
https://github.com/apache/wicket/blob/2c673f340539812d26a8a8a4153ed6d8505e5628/wicket-core/src/test/java/org/apache/wicket/ajax/markup/html/ajaxLink/AjaxLinkTest.java#L85

Martin Grigorov
Wicket Training and Consulting
https://twitter.com/mtgrigorov

On Thu, Dec 15, 2016 at 3:39 PM, Boris Goldowsky 
wrote:

> It can be convenient to write a unit test that essentially says, “this
> component should return this HTML” (or perhaps a slightly abstracted view
> of the HTML DOM).  Snapshot testing frameworks automate this (eg, making it
> easy to update the expected DOM when you intentionally change your
> component).  I’m wondering if this is possible for a wicket app; I’ve so
> far only seen it done with ReactJS.
>
> See https://medium.com/@dschmidt1992/jest-snapshot-testing-3ef9fa1222bb
> for a better explanation of the basic idea.
>
> Boris
>
>
> On 12/15/16, 7:04 AM, "Martin Grigorov"  wrote:
>
> Hi,
>
> What exactly do you need to do ?
> To test your application against Wicket 7.6.0-SNAPSHOT ?
>
> Martin Grigorov
> Wicket Training and Consulting
> https://twitter.com/mtgrigorov
>
> On Thu, Dec 15, 2016 at 12:40 PM, Boris Goldowsky  >
> wrote:
>
> > Has anyone implemented snapshot testing for a wicket app or have
> > suggestions on how it might be done?
> >
> > Boris
> >
> > (yes, I know there are different schools of thought on whether
> snapshot
> > testing is a good idea or not)
> >
> >
> >
>
>
>


Change language

2016-12-15 Thread Olivier Dutrieux
I have ajax dropdown list like this :

 
where I can change the language of the application :

 
I use StringResourceModel on class and wicket:message key='...' and
wicket:message attribute on tag : everythink work fine.

At this time to switch language I use :

But I have a problem with some composants where some parameters are not
model like for example DateTextField where the patternDate is a string not a
model :

For french this parameter need to be dd/MM/ and for english need to be
MM/dd/.

To solve this problem I need to recreate the page like this :


I have the same problem with behavior like ConfirmationBehavior (wicket
Bootstrap) where on config you can specify label of button.

To solve this problem I can use the solution above or add the behavior on
onConfigure method and set temporary (but it's not clean but that's work).

So I would like to know what is the best practice (recommendation) for this
use case (switch language) :

create new page : setResponsePage(getPage().class);
or 
re-use page : setResponsePage(getPage());
Thx advance for your reply

Duto

-
Duto
--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Change-language-tp4676460.html
Sent from the Users forum mailing list archive at Nabble.com.

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: Snapshot testing for wicket?

2016-12-15 Thread Boris Goldowsky
It can be convenient to write a unit test that essentially says, “this 
component should return this HTML” (or perhaps a slightly abstracted view of 
the HTML DOM).  Snapshot testing frameworks automate this (eg, making it easy 
to update the expected DOM when you intentionally change your component).  I’m 
wondering if this is possible for a wicket app; I’ve so far only seen it done 
with ReactJS.

See https://medium.com/@dschmidt1992/jest-snapshot-testing-3ef9fa1222bb  for a 
better explanation of the basic idea.

Boris


On 12/15/16, 7:04 AM, "Martin Grigorov"  wrote:

Hi,

What exactly do you need to do ?
To test your application against Wicket 7.6.0-SNAPSHOT ?

Martin Grigorov
Wicket Training and Consulting
https://twitter.com/mtgrigorov

On Thu, Dec 15, 2016 at 12:40 PM, Boris Goldowsky 
wrote:

> Has anyone implemented snapshot testing for a wicket app or have
> suggestions on how it might be done?
>
> Boris
>
> (yes, I know there are different schools of thought on whether snapshot
> testing is a good idea or not)
>
>
>




Re: Snapshot testing for wicket?

2016-12-15 Thread Martin Grigorov
Hi,

What exactly do you need to do ?
To test your application against Wicket 7.6.0-SNAPSHOT ?

Martin Grigorov
Wicket Training and Consulting
https://twitter.com/mtgrigorov

On Thu, Dec 15, 2016 at 12:40 PM, Boris Goldowsky 
wrote:

> Has anyone implemented snapshot testing for a wicket app or have
> suggestions on how it might be done?
>
> Boris
>
> (yes, I know there are different schools of thought on whether snapshot
> testing is a good idea or not)
>
>
>


Snapshot testing for wicket?

2016-12-15 Thread Boris Goldowsky
Has anyone implemented snapshot testing for a wicket app or have suggestions on 
how it might be done?

Boris

(yes, I know there are different schools of thought on whether snapshot testing 
is a good idea or not)