Added anyDateWithTimezoneOffset matcher to e2e framework

refs https://github.com/TryGhost/Toolbox/issues/215
refs https://github.com/TryGhost/Ghost/issues/10065

- The dates in Content API are returned with UTC offset which does not play ball with existing "anyDate" matcher. Created a new matcher to underline the difference in date formatting between Content and Admin APIs
This commit is contained in:
Naz 2022-02-23 17:11:00 +07:00
parent fa373e0956
commit 9f0545b133

View File

@ -278,6 +278,7 @@ module.exports = {
anyArray: any(Array),
anyDate: stringMatching(/\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.000Z/),
anyShortDate: stringMatching(/\d{4}-\d{2}-\d{2}/),
anyDateWithTimezoneOffset: stringMatching(/\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.000\+\d{2}:\d{2}/),
anyEtag: stringMatching(/(?:W\/)?"(?:[ !#-\x7E\x80-\xFF]*|\r\n[\t ]|\\.)*"/),
anyObjectId: stringMatching(/[a-f0-9]{24}/),
anyErrorId: stringMatching(/[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}/),