Skip to content

Commit

Permalink
fix: duplicate id in report error e2e
Browse files Browse the repository at this point in the history
  • Loading branch information
arthurgeron committed Nov 12, 2024
1 parent 161aacc commit 441af6d
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions packages/app/playwright/e2e/ReportError.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,12 @@ test.describe('ReportError', () => {
});
}

test.beforeEach(async () => {
await page.evaluate(async () => {
await window.fuelDB.errors.clear();
});
});

test('should show Error page when there is a unhandled js error in React', async () => {
await visit(page, '/');
await page.evaluate(() => {
Expand All @@ -50,7 +56,6 @@ test.describe('ReportError', () => {
test('should show Review Error in menu when there is a error in the database', async () => {
await visit(page, '/');
await page.evaluate(async () => {
await window.fuelDB.errors.clear();
await window.fuelDB.errors.add({
id: '12345',
error: {
Expand All @@ -77,7 +82,6 @@ test.describe('ReportError', () => {
test('should be able to ignore a error', async () => {
await visit(page, '/');
await page.evaluate(async () => {
await window.fuelDB.errors.clear();
await window.fuelDB.errors.add({
id: '12345',
error: {
Expand Down Expand Up @@ -109,7 +113,6 @@ test.describe('ReportError', () => {
test('should be able to dismiss all errors', async () => {
await visit(page, '/');
await page.evaluate(async () => {
await window.fuelDB.errors.clear();
await window.fuelDB.errors.add({
id: '12345',
error: {
Expand Down Expand Up @@ -144,7 +147,6 @@ test.describe('ReportError', () => {
test('should hide when the single error is dismissed', async () => {
await visit(page, '/');
await page.evaluate(async () => {
await window.fuelDB.errors.clear();
await window.fuelDB.errors.add({
id: '12345',
error: {
Expand Down Expand Up @@ -176,7 +178,6 @@ test.describe('ReportError', () => {
test('should detect and capture global errors', async () => {
await visit(page, '/');
await page.evaluate(async () => {
await window.fuelDB.errors.clear();
console.error(new Error('Test Error'));
});
await reload(page);
Expand All @@ -191,7 +192,6 @@ test.describe('ReportError', () => {
test('should deduplicate errors', async () => {
await visit(page, '/');
await page.evaluate(async () => {
await window.fuelDB.errors.clear();
await window.fuelDB.errors.add({
id: '12345',
error: {
Expand All @@ -208,7 +208,7 @@ test.describe('ReportError', () => {
},
});
await window.fuelDB.errors.add({
id: '12345',
id: '123456',
error: {
name: 'React error',
message: 'Test Error',
Expand Down

0 comments on commit 441af6d

Please sign in to comment.