mirror of
https://github.com/hanzoai/sentinel.git
synced 2026-09-29 22:34:33 +00:00
34 lines
830 B
TypeScript
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');
|
|
});
|
|
});
|