woocommerce-ios icon indicating copy to clipboard operation
woocommerce-ios copied to clipboard

Unit Tests: Add method to randomize dates

Open iamgabrielma opened this issue 2 years ago • 1 comments

At the moment we're hardcoding dates in all our tests, for example ProductVariationMapperTests or ProductVariationsRemoteTests, for multiple parameters like dateCreated, dateModified, dateOnSaleStart, dateOnSaleEnd

An idea from https://github.com/woocommerce/woocommerce-ios/pull/7080#pullrequestreview-1005173104 could be to randomize these, for example in our DateFormatter extension:

I think having a method for randomizing dates is actually a good thought! We could probably add a parameter in that method to make it possible to randomize a date from the past or the future, that will come in handy as well.

iamgabrielma avatar Jun 23 '22 14:06 iamgabrielma

Fails
:no_entry_sign: Please add a feature label to this issue. e.g. 'feature: stats'

Generated by :no_entry_sign: dangerJS

peril-woocommerce[bot] avatar Jun 23 '22 14:06 peril-woocommerce[bot]