feat(editor): Removing ph-no-capture class from some elements (#6674)
* feat(editor): Remove `.ph-no-capture` class from some of the fields * ✔️ Updating test snapshots * ⚡ Redacting expressions preview in credentials form * 🔧 Disable posthog input masking * 🚨 Testing PostHog iFrame settings * Reverting iframe test * ⚡ Hiding API key in PostHog recordings * ✅ Added tests for redacted values * ✔️ Updating checkbox snapshots after label component update * ✔️ Updating test snapshots in editor-ui * 👕 Fix lint errors
This commit is contained in:
committed by
GitHub
parent
250175d066
commit
c3455a4ad8
@@ -0,0 +1,51 @@
|
||||
import { PiniaVuePlugin } from 'pinia';
|
||||
import { render } from '@testing-library/vue';
|
||||
import { merge } from 'lodash-es';
|
||||
|
||||
import { SETTINGS_STORE_DEFAULT_STATE } from '@/__tests__/utils';
|
||||
import { STORES } from '@/constants';
|
||||
|
||||
import { createTestingPinia } from '@pinia/testing';
|
||||
import CopyInput from '@/components/CopyInput.vue';
|
||||
|
||||
const DEFAULT_SETUP = {
|
||||
pinia: createTestingPinia({
|
||||
initialState: {
|
||||
[STORES.SETTINGS]: {
|
||||
settings: merge({}, SETTINGS_STORE_DEFAULT_STATE.settings),
|
||||
},
|
||||
},
|
||||
}),
|
||||
props: {
|
||||
copyButtonText: 'Click to copy',
|
||||
label: 'Copy Input test',
|
||||
},
|
||||
};
|
||||
|
||||
const renderComponent = (renderOptions: Parameters<typeof render>[1] = {}) =>
|
||||
render(CopyInput, merge(DEFAULT_SETUP, renderOptions), (vue) => {
|
||||
vue.use(PiniaVuePlugin);
|
||||
});
|
||||
|
||||
describe('BannerStack', () => {
|
||||
afterEach(() => {
|
||||
vi.clearAllMocks();
|
||||
});
|
||||
|
||||
it('should render default configuration', async () => {
|
||||
const { getByTestId } = renderComponent();
|
||||
expect(getByTestId('input-label')).toHaveTextContent('Copy Input test');
|
||||
expect(getByTestId('copy-input')).toHaveTextContent('Click to copy');
|
||||
});
|
||||
|
||||
it('should render redacted version', async () => {
|
||||
const { container, getByTestId } = renderComponent(
|
||||
merge(DEFAULT_SETUP, {
|
||||
props: {
|
||||
redactValue: true,
|
||||
},
|
||||
}),
|
||||
);
|
||||
expect(getByTestId('copy-input')).toHaveClass('ph-no-capture');
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user