feat: SAML feedback changes [CW-5666] (#12511)
This commit is contained in:
@@ -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>
|
||||
|
||||
@@ -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);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user