From 9f0545b133b03e06fadc0423d0a9e91cae70baae Mon Sep 17 00:00:00 2001 From: Naz Date: Wed, 23 Feb 2022 17:11:00 +0700 Subject: [PATCH] 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 --- test/utils/e2e-framework.js | 1 + 1 file changed, 1 insertion(+) diff --git a/test/utils/e2e-framework.js b/test/utils/e2e-framework.js index ff99417cee..1aac991758 100644 --- a/test/utils/e2e-framework.js +++ b/test/utils/e2e-framework.js @@ -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}/),