-
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(sentry apps): Add backwards compatbility for SentryAppCompenent…
… errors (#81480) In (#81167 ), we want to change the SentryAppComponent endpoint to return a string of the error to improve end user clarity when debugging. In the frontend, we currently expect the error response to be a boolean though, so we need to make the frontend backwards compatible (i.e handle both boolean and string)
- Loading branch information
1 parent
3fe00a0
commit 293a435
Showing
5 changed files
with
38 additions
and
4 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
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 |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import {SentryAppComponentFixture} from 'sentry-fixture/sentryAppComponent'; | ||
|
||
import {sentryAppComponentIsDisabled} from 'sentry/components/sentryAppComponentIcon'; | ||
|
||
describe('SentryAppComponentIcon', function () { | ||
it('sentryAppComponentIsDisabled returns false if the error is a non empty string', () => { | ||
const component = SentryAppComponentFixture(); | ||
component.error = 'RIP couldnt connect to sentry :C'; | ||
expect(sentryAppComponentIsDisabled(component)).toBe(false); | ||
}); | ||
|
||
it('sentryAppComponentIsDisabled returns true if the error is an empty string', () => { | ||
const component = SentryAppComponentFixture(); | ||
component.error = ''; | ||
expect(sentryAppComponentIsDisabled(component)).toBe(true); | ||
}); | ||
|
||
// TODO: Delete after new errors are deployed | ||
it('sentryAppComponentIsDisabled returns itself if the error is a boolean', () => { | ||
const component = SentryAppComponentFixture(); | ||
component.error = true; | ||
expect(sentryAppComponentIsDisabled(component)).toBe(true); | ||
}); | ||
}); |
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