-
Notifications
You must be signed in to change notification settings - Fork 5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Set sentry autoTrackSessions default #20132
Changes from all commits
fb77780
ff82a23
400512a
87b4dd4
3c75a8e
9dff5a3
d334403
07dda82
78b278f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||
---|---|---|---|---|---|---|---|---|
|
@@ -23,6 +23,36 @@ describe('Sentry errors', function () { | |||||||
}, | ||||||||
], | ||||||||
}; | ||||||||
it('should NOT send error events when participateInMetaMetrics is false', async function () { | ||||||||
await withFixtures( | ||||||||
{ | ||||||||
fixtures: new FixtureBuilder() | ||||||||
.withMetaMetricsController({ | ||||||||
metaMetricsId: null, | ||||||||
participateInMetaMetrics: false, | ||||||||
}) | ||||||||
.build(), | ||||||||
ganacheOptions, | ||||||||
title: this.test.title, | ||||||||
failOnConsoleError: false, | ||||||||
testSpecificMock: mockSentry, | ||||||||
}, | ||||||||
async ({ driver, mockedEndpoint }) => { | ||||||||
await driver.navigate(); | ||||||||
await driver.fill('#password', 'correct horse battery staple'); | ||||||||
await driver.press('#password', driver.Key.ENTER); | ||||||||
Comment on lines
+42
to
+43
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||
// Trigger error | ||||||||
driver.executeScript('window.stateHooks.throwTestError()'); | ||||||||
driver.delay(3000); | ||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Question: is there a way to bypass the delay here? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No we need to wait sometime to give time for a network request to occur There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In the inverse test, we wait for a specific network request. I want to give a similar pause but we can't wait for anything in particular. |
||||||||
// Wait for Sentry request | ||||||||
const isPending = await mockedEndpoint.isPending(); | ||||||||
assert.ok( | ||||||||
isPending, | ||||||||
'A request to sentry was sent when it should not have been', | ||||||||
); | ||||||||
}, | ||||||||
); | ||||||||
}); | ||||||||
it('should send error events', async function () { | ||||||||
await withFixtures( | ||||||||
{ | ||||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we use
jest.fn()
here to mock?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not without rewriting the tests to jest. Currently in mocha