Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove inaccessible language switcher modal. #11718

Merged
merged 1 commit into from
Jan 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 0 additions & 10 deletions kolibri/core/assets/src/views/CorePage/AppBarPage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
class="app-bar"
:title="title"
@toggleSideNav="navShown = !navShown"
@showLanguageModal="languageModalShown = true"
>
<template #sub-nav>
<slot name="subNav"></slot>
Expand Down Expand Up @@ -44,12 +43,6 @@
@shouldFocusFirstEl="findFirstEl()"
/>
</transition>
<LanguageSwitcherModal
v-if="languageModalShown"
ref="languageSwitcherModal"
:style="{ color: $themeTokens.text }"
@cancel="languageModalShown = false"
/>

</div>

Expand All @@ -60,7 +53,6 @@

import { mapGetters } from 'vuex';
import { throttle } from 'frame-throttle';
import LanguageSwitcherModal from 'kolibri.coreVue.components.LanguageSwitcherModal';
import ScrollingHeader from 'kolibri.coreVue.components.ScrollingHeader';
import useKResponsiveWindow from 'kolibri.coreVue.composables.useKResponsiveWindow';
import SideNav from 'kolibri.coreVue.components.SideNav';
Expand All @@ -75,7 +67,6 @@
name: 'AppBarPage',
components: {
AppBar,
LanguageSwitcherModal,
ScrollingHeader,
SideNav,
StorageNotification,
Expand Down Expand Up @@ -110,7 +101,6 @@
data() {
return {
appBarHeight: 0,
languageModalShown: false,
navShown: false,
lastScrollTop: 0,
hideAppBars: true,
Expand Down
16 changes: 0 additions & 16 deletions kolibri/core/assets/test/views/app-bar-core-page.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,20 +64,4 @@ describe('AppBarPage', () => {
expect(wrapper.findComponent({ name: 'SideNav' }).vm.navShown).toBe(false);
});
});

describe('Toggling the language switcher modal', () => {
it('should show the side nav when the AppBar.showLanguageModal event is emitted', async () => {
const wrapper = createWrapper();
expect(wrapper.findComponent({ name: 'LanguageSwitcherModal' }).exists()).toBe(false);
await wrapper.vm.$refs.appBar.$emit('showLanguageModal');
expect(wrapper.findComponent({ name: 'LanguageSwitcherModal' }).exists()).toBe(true);
});
it('should hide the language switcher modal when LanguageSwitcherModal.cancel is emitted', async () => {
const wrapper = createWrapper();
await wrapper.setData({ languageModalShown: true });
expect(wrapper.findComponent({ name: 'LanguageSwitcherModal' }).exists()).toBe(true);
await wrapper.vm.$refs.languageSwitcherModal.$emit('cancel');
expect(wrapper.findComponent({ name: 'LanguageSwitcherModal' }).exists()).toBe(false);
});
});
});