generated from Seekra/repository-template
refactor(settings)!: rename Switch to SettingsSwitch
Vue.js components should have multi-word names.
This commit is contained in:
@@ -18,7 +18,7 @@ limitations under the License.
|
|||||||
import Selection from './Selection.vue';
|
import Selection from './Selection.vue';
|
||||||
import SettingsInput from './SettingsInput.vue';
|
import SettingsInput from './SettingsInput.vue';
|
||||||
import SettingsPageLink from './SettingsPageLink.vue';
|
import SettingsPageLink from './SettingsPageLink.vue';
|
||||||
import Switch from './Switch.vue';
|
import SettingsSwitch from './SettingsSwitch.vue';
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
|
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
@@ -43,7 +43,7 @@ const props = defineProps({
|
|||||||
:key="setting"
|
:key="setting"
|
||||||
class="setting"
|
class="setting"
|
||||||
>
|
>
|
||||||
<Switch
|
<SettingsSwitch
|
||||||
v-if="setting.type === 'bool'"
|
v-if="setting.type === 'bool'"
|
||||||
:setting="setting"
|
:setting="setting"
|
||||||
:path="`${props.path}.${setting.name}`"
|
:path="`${props.path}.${setting.name}`"
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ import Selection from '../Selection.vue';
|
|||||||
import SettingsInput from '../SettingsInput.vue';
|
import SettingsInput from '../SettingsInput.vue';
|
||||||
import SettingsPage from '../SettingsPage.vue';
|
import SettingsPage from '../SettingsPage.vue';
|
||||||
import SettingsPageLink from '../SettingsPageLink.vue';
|
import SettingsPageLink from '../SettingsPageLink.vue';
|
||||||
import Switch from '../Switch.vue';
|
import SettingsSwitch from '../SettingsSwitch.vue';
|
||||||
import { mountComponent } from '@/test-utils/mountComponent.js';
|
import { mountComponent } from '@/test-utils/mountComponent.js';
|
||||||
import { describe, expect, test } from 'vitest';
|
import { describe, expect, test } from 'vitest';
|
||||||
|
|
||||||
@@ -108,7 +108,7 @@ describe('SettingsPage', () => {
|
|||||||
exampleSettings.forEach((expectedSetting, index) => {
|
exampleSettings.forEach((expectedSetting, index) => {
|
||||||
const settingWrapper = settingsWrappers[index];
|
const settingWrapper = settingsWrappers[index];
|
||||||
|
|
||||||
const switchSetting = settingWrapper.findComponent(Switch);
|
const switchSetting = settingWrapper.findComponent(SettingsSwitch);
|
||||||
const inputSetting = settingWrapper.findComponent(SettingsInput);
|
const inputSetting = settingWrapper.findComponent(SettingsInput);
|
||||||
const selectionSetting = settingWrapper.findComponent(Selection);
|
const selectionSetting = settingWrapper.findComponent(Selection);
|
||||||
const settingsPageLink = settingWrapper.findComponent(SettingsPageLink);
|
const settingsPageLink = settingWrapper.findComponent(SettingsPageLink);
|
||||||
|
|||||||
+3
-3
@@ -15,7 +15,7 @@ limitations under the License.
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import { useSettingsStore } from '../../stores/settingsStore.js';
|
import { useSettingsStore } from '../../stores/settingsStore.js';
|
||||||
import Switch from '../Switch.vue';
|
import SettingsSwitch from '../SettingsSwitch.vue';
|
||||||
import { mountComponent } from '@/test-utils/mountComponent.js';
|
import { mountComponent } from '@/test-utils/mountComponent.js';
|
||||||
import { describe, expect, test } from 'vitest';
|
import { describe, expect, test } from 'vitest';
|
||||||
import { nextTick } from 'vue';
|
import { nextTick } from 'vue';
|
||||||
@@ -26,7 +26,7 @@ const getWrapper = function getWrapper({
|
|||||||
translations = {},
|
translations = {},
|
||||||
piniaOptions = {}
|
piniaOptions = {}
|
||||||
} = {}) {
|
} = {}) {
|
||||||
return mountComponent(Switch, {
|
return mountComponent(SettingsSwitch, {
|
||||||
attrs: {
|
attrs: {
|
||||||
setting: {
|
setting: {
|
||||||
type: 'bool',
|
type: 'bool',
|
||||||
@@ -39,7 +39,7 @@ const getWrapper = function getWrapper({
|
|||||||
}, translations, [], piniaOptions);
|
}, translations, [], piniaOptions);
|
||||||
};
|
};
|
||||||
|
|
||||||
describe('Switch', () => {
|
describe('SettingsSwitch', () => {
|
||||||
test('shows value from store', async () => {
|
test('shows value from store', async () => {
|
||||||
const wrapper = getWrapper();
|
const wrapper = getWrapper();
|
||||||
|
|
||||||
Reference in New Issue
Block a user