-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Undefined deny list ignores block internal (#629)
- Loading branch information
1 parent
503b38a
commit 27a1b04
Showing
2 changed files
with
44 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,49 @@ | ||
describe('spa harvesting', () => { | ||
it('should set correct customEnd value on multiple custom interactions', async () => { | ||
const [interactionResults] = await Promise.all([ | ||
// interaction3 will eventually be harvested so we need to capture two harvests here | ||
|
||
const [interactionResults1, interactionResults2] = await Promise.all([ | ||
browser.testHandle.expectInteractionEvents(), | ||
browser.testHandle.expectInteractionEvents(), | ||
browser.url(await browser.testHandle.assetURL('spa/multiple-custom-interactions.html')) | ||
.then(() => browser.waitForAgentLoad()) | ||
]) | ||
|
||
const interactions = interactionResults.request.body | ||
expect(interactions.length).toEqual(3) | ||
const interactions = [ | ||
...interactionResults1.request.body, | ||
...interactionResults2.request.body | ||
] | ||
expect(interactions.length).toEqual(4) | ||
expect(interactions).toEqual(expect.arrayContaining([ | ||
expect.objectContaining({ | ||
customName: 'interaction1' | ||
customName: 'interaction1', | ||
children: expect.arrayContaining([expect.objectContaining({ | ||
type: 'customEnd' | ||
})]) | ||
}), | ||
expect.objectContaining({ | ||
customName: 'interaction2' | ||
customName: 'interaction2', | ||
children: expect.arrayContaining([expect.objectContaining({ | ||
type: 'customEnd' | ||
})]) | ||
}), | ||
expect.objectContaining({ | ||
customName: 'interaction4' | ||
customName: 'interaction3', | ||
children: expect.not.arrayContaining([expect.objectContaining({ | ||
type: 'customEnd' | ||
})]) | ||
}), | ||
expect.objectContaining({ | ||
customName: 'interaction4', | ||
children: expect.arrayContaining([expect.objectContaining({ | ||
type: 'customEnd' | ||
})]) | ||
}) | ||
])) | ||
interactions.forEach(interaction => { | ||
const customEndTime = interaction.children.find(child => child.type === 'customEnd') | ||
expect(customEndTime.time).toBeGreaterThanOrEqual(interaction.end) | ||
}) | ||
interactions | ||
.filter(interaction => ['interaction1', 'interaction2', 'interaction4'].includes(interaction.customName)) | ||
.forEach(interaction => { | ||
const customEndTime = interaction.children.find(child => child.type === 'customEnd') | ||
expect(customEndTime.time).toBeGreaterThanOrEqual(interaction.end) | ||
}) | ||
}) | ||
}) |