Files
sentinel/static/app/utils/getDynamicText.spec.tsx
2024-02-15 17:01:50 +00:00

34 lines
830 B
TypeScript

describe('getDynamicText', function () {
beforeEach(() => {
jest.resetModules();
});
it('renders actual value', function () {
jest.doMock('sentry/constants', () => ({
IS_ACCEPTANCE_TEST: false,
}));
const getDynamicText = require('sentry/utils/getDynamicText').default;
expect(
getDynamicText({
fixed: 'Text',
value: 'Dynamic Content',
})
).toEqual('Dynamic Content');
});
it('renders fixed content when `app/constants/IS_ACCEPTANCE_TEST` is true', function () {
jest.doMock('sentry/constants', () => ({
IS_ACCEPTANCE_TEST: true,
}));
const getDynamicText = require('sentry/utils/getDynamicText').default;
expect(
getDynamicText({
fixed: 'Text',
value: 'Dynamic Content',
})
).toEqual('Text');
});
});