|
1 | | -import { click, visit } from '@ember/test-helpers'; |
| 1 | +import { click, find, visit } from '@ember/test-helpers'; |
2 | 2 | import { setupApplicationTest } from 'ember-qunit'; |
3 | 3 | import { module, test } from 'qunit'; |
4 | 4 |
|
@@ -56,4 +56,45 @@ module('Acceptance | Sentry Performance', function (hooks) { |
56 | 56 | }, |
57 | 57 | }); |
58 | 58 | }); |
| 59 | + |
| 60 | + test('Test page with loading state', async function (assert) { |
| 61 | + await visit('/with-loading'); |
| 62 | + |
| 63 | + assertSentryTransactionCount(assert, 1); |
| 64 | + assertSentryTransactions(assert, 0, { |
| 65 | + spans: [ |
| 66 | + 'ui.ember.transition | route:undefined -> route:with-loading.index', |
| 67 | + 'ui.ember.route.before_model | with-loading.index', |
| 68 | + 'ui.ember.route.model | with-loading.index', |
| 69 | + 'ui.ember.route.after_model | with-loading.index', |
| 70 | + 'ui.ember.route.setup_controller | with-loading.index', |
| 71 | + ], |
| 72 | + transaction: 'route:with-loading.index', |
| 73 | + tags: { |
| 74 | + fromRoute: undefined, |
| 75 | + toRoute: 'with-loading.index', |
| 76 | + }, |
| 77 | + }); |
| 78 | + }); |
| 79 | + |
| 80 | + test('Test page with error state', async function (assert) { |
| 81 | + await visit('/with-error'); |
| 82 | + |
| 83 | + // Ensure we are on error page |
| 84 | + assert.ok(find('#test-page-load-error')); |
| 85 | + |
| 86 | + assertSentryTransactionCount(assert, 1); |
| 87 | + assertSentryTransactions(assert, 0, { |
| 88 | + spans: [ |
| 89 | + 'ui.ember.transition | route:undefined -> route:with-error.index', |
| 90 | + 'ui.ember.route.before_model | with-error.index', |
| 91 | + 'ui.ember.route.model | with-error.index', |
| 92 | + ], |
| 93 | + transaction: 'route:with-error.index', |
| 94 | + tags: { |
| 95 | + fromRoute: undefined, |
| 96 | + toRoute: 'with-error.index', |
| 97 | + }, |
| 98 | + }); |
| 99 | + }); |
59 | 100 | }); |
0 commit comments