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

@@ -5,6 +5,10 @@ export default {
type: String,
default: '',
},
bg: {
type: String,
default: 'bg-white dark:bg-n-solid-2',
},
},
};
</script>
@@ -15,7 +19,7 @@ export default {
<div class="w-full border-t border-n-strong" />
</div>
<div v-if="label" class="relative flex justify-center text-sm">
<span class="bg-white dark:bg-n-solid-2 px-2 text-n-slate-10">
<span class="px-2 text-n-slate-10" :class="bg">
{{ label }}
</span>
</div>

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);
});
});

View File

@@ -1,16 +1,5 @@
<script>
import SimpleDivider from '../Divider/SimpleDivider.vue';
export default {
components: {
SimpleDivider,
},
props: {
showSeparator: {
type: Boolean,
default: true,
},
},
methods: {
getGoogleAuthUrl() {
// Ideally a request to /auth/google_oauth2 should be made
@@ -52,11 +41,5 @@ export default {
{{ $t('LOGIN.OAUTH.GOOGLE_LOGIN') }}
</span>
</a>
<SimpleDivider
v-if="showSeparator"
ref="divider"
:label="$t('COMMON.OR')"
class="uppercase"
/>
</div>
</template>