diff --git a/ghost/core/test/e2e-webhooks/posts.test.js b/ghost/core/test/e2e-webhooks/posts.test.js index ad9f435843f..2932c4cef28 100644 --- a/ghost/core/test/e2e-webhooks/posts.test.js +++ b/ghost/core/test/e2e-webhooks/posts.test.js @@ -1,5 +1,5 @@ const {agentProvider, mockManager, fixtureManager, matchers} = require('../utils/e2e-framework'); -const {anyObjectId, anyISODateTime, anyUuid, anyContentVersion, anyNumber, stringMatching} = matchers; +const {anyObjectId, anyISODateTime, anyUuid, anyContentVersion, anyNumber, anyLocalURL} = matchers; const tierSnapshot = { id: anyObjectId, @@ -35,9 +35,7 @@ const buildPostSnapshotWithTiers = ({published, tiersCount, roles = false}) => { published_at: published ? anyISODateTime : null, created_at: anyISODateTime, updated_at: anyISODateTime, - // @TODO: hack here! it's due to https://github.com/TryGhost/Toolbox/issues/341 - // this matcher should be removed once the issue is solved - url: stringMatching(/http:\/\/127.0.0.1:2369\/\w+\//), + url: anyLocalURL, tiers: new Array(tiersCount).fill(tierSnapshot), primary_author: buildAuthorSnapshot(roles), authors: new Array(1).fill(buildAuthorSnapshot(roles)) diff --git a/ghost/core/test/utils/e2e-framework.js b/ghost/core/test/utils/e2e-framework.js index 222e272bec1..68b0754909f 100644 --- a/ghost/core/test/utils/e2e-framework.js +++ b/ghost/core/test/utils/e2e-framework.js @@ -368,6 +368,10 @@ module.exports = { anyLocationFor: (resource) => { return stringMatching(new RegExp(`https?://.*?/${resource}/[a-f0-9]{24}/`)); }, + // @NOTE: hack here! it's due to https://github.com/TryGhost/Toolbox/issues/341 + // this matcher should be removed once the issue is solved - routing is redesigned + // An ideal solution would be removal of this matcher altogether. + anyLocalURL: stringMatching(/http:\/\/127.0.0.1:2369\/\w+\//), stringMatching },