-
Notifications
You must be signed in to change notification settings - Fork 432
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: remove sentry error reporter test for now
- Loading branch information
1 parent
9a22558
commit 626a67e
Showing
9 changed files
with
81 additions
and
35 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,28 @@ | ||
import { Button } from '@sanity/ui' | ||
import { defineField, defineType } from 'sanity' | ||
|
||
export default defineType({ | ||
name: 'error', | ||
type: 'document', | ||
title: 'Error', | ||
fields: [ | ||
defineField({ | ||
name: 'title', | ||
title: 'Title', | ||
type: 'string', | ||
components: { | ||
input: () => { | ||
const errorFunc = () => { | ||
throw new Error('This is not a real error: we are just testing') | ||
} | ||
return ( | ||
<Button | ||
onClick={errorFunc} | ||
text='Throw error' | ||
/> | ||
) | ||
} | ||
} | ||
}), | ||
] | ||
}) |
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
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,43 @@ | ||
import {expect} from '@playwright/test' | ||
import {test} from '@sanity/test' | ||
|
||
import {SANITY_E2E_IS_AUTO_UPDATING} from '../../env' | ||
|
||
const TELEMETRY_URL = 'https://**/intake/telemetry-status**' | ||
const SENTRY_URL = 'https://sanity.sentry.io/**' | ||
|
||
test('Error reporter should initialize if in an updating studio and telemetry is granted', async ({ | ||
page, | ||
createDraftDocument, | ||
}) => { | ||
let apiCalled = false | ||
|
||
await createDraftDocument('test/content/input-debug;error') | ||
//force telemetry to be enabled | ||
await page.route(TELEMETRY_URL, (route) => { | ||
route.fulfill({ | ||
status: 200, | ||
contentType: 'application/json', | ||
body: JSON.stringify({ | ||
status: 'enabled', | ||
}), | ||
}) | ||
}) | ||
|
||
await page.getByText('Throw error').click() | ||
|
||
await page.route(SENTRY_URL, (route) => { | ||
apiCalled = true | ||
route.fulfill({ | ||
status: 200, | ||
contentType: 'application/json', | ||
body: JSON.stringify({}), | ||
}) | ||
}) | ||
|
||
if (SANITY_E2E_IS_AUTO_UPDATING) { | ||
expect(apiCalled).toBe(true) | ||
} else { | ||
expect(apiCalled).toBe(false) | ||
} | ||
}) |
33 changes: 0 additions & 33 deletions
33
test/e2e/tests/error-reporting/sentryErrorReporter.test.ts
This file was deleted.
Oops, something went wrong.