feat: SAML feedback changes [CW-5666] (#12511)

This commit is contained in:
Shivam Mishra
2025-09-24 16:07:07 +05:30
committed by GitHub
parent eadbddaa9f
commit d3cd647e49
18 changed files with 116 additions and 78 deletions

View File

@@ -1,9 +1,8 @@
import { shallowMount } from '@vue/test-utils';
import GoogleOAuthButton from './Button.vue';
function getWrapper(showSeparator) {
function getWrapper() {
return shallowMount(GoogleOAuthButton, {
propsData: { showSeparator: showSeparator },
mocks: { $t: text => text },
});
}
@@ -20,16 +19,6 @@ describe('GoogleOAuthButton.vue', () => {
window.chatwootConfig = {};
});
it('renders the OR separator if showSeparator is true', () => {
const wrapper = getWrapper(true);
expect(wrapper.findComponent({ ref: 'divider' }).exists()).toBe(true);
});
it('does not render the OR separator if showSeparator is false', () => {
const wrapper = getWrapper(false);
expect(wrapper.findComponent({ ref: 'divider' }).exists()).toBe(false);
});
it('generates the correct Google Auth URL', () => {
const wrapper = getWrapper();
const googleAuthUrl = new URL(wrapper.vm.getGoogleAuthUrl());
@@ -42,7 +31,5 @@ describe('GoogleOAuthButton.vue', () => {
);
expect(params.get('response_type')).toBe('code');
expect(params.get('scope')).toBe('email profile');
expect(wrapper.findComponent({ ref: 'divider' }).exists()).toBe(true);
});
});