Skip to content

Commit

Permalink
feat(angular-onboarding): Add standalone app docs (#77302)
Browse files Browse the repository at this point in the history
Add platform option to `javascript-angular` that allows to switch
between standalone / module app initialization.

Closes #77134
  • Loading branch information
ArthurKnaus authored Sep 13, 2024
1 parent 5ad0ace commit cd5b45a
Show file tree
Hide file tree
Showing 2 changed files with 190 additions and 111 deletions.
20 changes: 16 additions & 4 deletions static/app/gettingStartedDocs/javascript/angular.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {textWithMarkupMatcher} from 'sentry-test/utils';

import {ProductSolution} from 'sentry/components/onboarding/productSelection';

import docs from './angular';
import docs, {AngularConfigType} from './angular';

describe('javascript-angular onboarding docs', function () {
it('renders onboarding docs correctly', () => {
Expand All @@ -18,14 +18,17 @@ describe('javascript-angular onboarding docs', function () {

// Includes import statement
expect(
screen.getByText(
textWithMarkupMatcher(/import { enableProdMode } from "@angular\/core"/)
screen.getAllByText(
textWithMarkupMatcher(/import \* as Sentry from "@sentry\/angular";/)
)
).toBeInTheDocument();
).toHaveLength(2);
});

it('displays sample rates by default', () => {
renderWithOnboardingLayout(docs, {
selectedOptions: {
configType: AngularConfigType.APP,
},
selectedProducts: [
ProductSolution.ERROR_MONITORING,
ProductSolution.PERFORMANCE_MONITORING,
Expand All @@ -46,6 +49,9 @@ describe('javascript-angular onboarding docs', function () {

it('enables performance setting the tracesSampleRate to 1', () => {
renderWithOnboardingLayout(docs, {
selectedOptions: {
configType: AngularConfigType.APP,
},
selectedProducts: [
ProductSolution.ERROR_MONITORING,
ProductSolution.PERFORMANCE_MONITORING,
Expand All @@ -59,6 +65,9 @@ describe('javascript-angular onboarding docs', function () {

it('enables replay by setting replay samplerates', () => {
renderWithOnboardingLayout(docs, {
selectedOptions: {
configType: AngularConfigType.APP,
},
selectedProducts: [
ProductSolution.ERROR_MONITORING,
ProductSolution.SESSION_REPLAY,
Expand All @@ -75,6 +84,9 @@ describe('javascript-angular onboarding docs', function () {

it('enables profiling by setting profiling sample rates', () => {
renderWithOnboardingLayout(docs, {
selectedOptions: {
configType: AngularConfigType.APP,
},
selectedProducts: [ProductSolution.ERROR_MONITORING, ProductSolution.PROFILING],
});

Expand Down
Loading

0 comments on commit cd5b45a

Please sign in to comment.