Skip to content

Commit

Permalink
Remove inaccessible language switcher modal.
Browse files Browse the repository at this point in the history
  • Loading branch information
rtibbles committed Jan 11, 2024
1 parent 6cbcd19 commit d7a21b3
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 26 deletions.
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);
});
});
});

0 comments on commit d7a21b3

Please sign in to comment.