darkmode hide and TODO

This commit is contained in:
ogerly 2023-06-30 16:02:02 +02:00
parent 59ecc14b29
commit acda4108b2
2 changed files with 35 additions and 35 deletions

View File

@ -108,33 +108,33 @@ describe('Settings', () => {
})
})
describe('darkMode style', () => {
it('default darkMode is true', () => {
expect(wrapper.vm.darkMode).toBe(true)
})
// TODO: describe('darkMode style', () => {
// it('default darkMode is true', () => {
// expect(wrapper.vm.darkMode).toBe(true)
// })
describe('dark mode is false', () => {
beforeEach(() => {
wrapper.vm.darkMode = false
})
// describe('dark mode is false', () => {
// beforeEach(() => {
// wrapper.vm.darkMode = false
// })
it('commits darkMode to store', () => {
expect(storeCommitMock).toBeCalledWith('setDarkMode', false)
})
it('toasts a success message', () => {
expect(toastSuccessSpy).toBeCalledWith('settings.modeLight')
})
// it('commits darkMode to store', () => {
// expect(storeCommitMock).toBeCalledWith('setDarkMode', false)
// })
// it('toasts a success message', () => {
// expect(toastSuccessSpy).toBeCalledWith('settings.modeLight')
// })
describe('set dark mode is true', () => {
beforeEach(() => {
wrapper.vm.darkMode = true
})
// Test case 1: Test setting dark mode
test('darkMode sets the dark mode', () => {
expect(storeCommitMock).toBeCalledWith('setDarkMode', true)
})
})
})
})
// describe('set dark mode is true', () => {
// beforeEach(() => {
// wrapper.vm.darkMode = true
// })
// // Test case 1: Test setting dark mode
// test('darkMode sets the dark mode', () => {
// expect(storeCommitMock).toBeCalledWith('setDarkMode', true)
// })
// })
// })
// })
})
})

View File

@ -76,12 +76,12 @@
<user-newsletter />
</b-col>
</b-row>
<b-row>
<!-- TODO<b-row>
<b-col cols="12" md="6" lg="6">{{ $t('settings.darkMode') }}</b-col>
<b-col cols="12" md="6" lg="6" class="text-right">
<b-form-checkbox v-model="darkMode" name="dark-mode" switch aligne></b-form-checkbox>
</b-col>
</b-row>
</b-row> -->
</div>
</template>
<script>
@ -126,14 +126,14 @@ export default {
return firstName === this.firstName && lastName === this.lastName
},
},
watch: {
darkMode(val) {
this.$store.commit('setDarkMode', this.darkMode)
this.toastSuccess(
this.darkMode ? this.$t('settings.modeDark') : this.$t('settings.modeLight'),
)
},
},
// TODO: watch: {
// darkMode(val) {
// this.$store.commit('setDarkMode', this.darkMode)
// this.toastSuccess(
// this.darkMode ? this.$t('settings.modeDark') : this.$t('settings.modeLight'),
// )
// },
// },
methods: {
async onSubmit(key) {
try {