Skip to content
Snippets Groups Projects
Commit 28c067b4 authored by Bat's avatar Bat
Browse files

Merge branch 'develop' into i18n-components

parents c744410f e4e97153
No related branches found
No related tags found
No related merge requests found
<template>
<div v-title="'Followers'">
<div class="ui vertical stripe segment">
<h2 class="ui header">Browsing followers</h2>
<h2 class="ui header">{{ $t('Browsing followers') }}</h2>
<p>
Be careful when accepting follow requests, as it means the follower
will have access to your entire library.
{{ $t('Be careful when accepting follow requests, as it means the follower will have access to your entire library.') }}
</p>
<div class="ui hidden divider"></div>
<library-follow-table></library-follow-table>
......
<template>
<div v-title="'Libraries'">
<div class="ui vertical stripe segment">
<h2 class="ui header">Browsing libraries</h2>
<h2 class="ui header">{{ $t('Browsing libraries') }}</h2>
<router-link
class="ui basic green button"
:to="{name: 'federation.libraries.scan'}">
<i class="plus icon"></i>
Add a new library
{{ $t('Add a new library') }}
</router-link>
<div class="ui hidden divider"></div>
<div :class="['ui', {'loading': isLoading}, 'form']">
<div class="fields">
<div class="field">
<label>Search</label>
<label>{{ $t('Search') }}</label>
<input type="text" v-model="query" placeholder="Enter an library domain name..."/>
</div>
<div class="field">
<label>Ordering</label>
<label>{{ $t('Ordering') }}</label>
<select class="ui dropdown" v-model="ordering">
<option v-for="option in orderingOptions" :value="option[0]">
{{ option[1] }}
......@@ -24,14 +24,14 @@
</select>
</div>
<div class="field">
<label>Ordering direction</label>
<label>{{ $t('Ordering direction') }}</label>
<select class="ui dropdown" v-model="orderingDirection">
<option value="">Ascending</option>
<option value="-">Descending</option>
<option value="">{{ $t('Ascending') }}</option>
<option value="-">{{ $t('Descending') }}</option>
</select>
</div>
<div class="field">
<label>Results per page</label>
<label>{{ $t('Results per page') }}</label>
<select class="ui dropdown" v-model="paginateBy">
<option :value="parseInt(12)">12</option>
<option :value="parseInt(25)">25</option>
......
<template>
<div v-title="'Federated tracks'">
<div class="ui vertical stripe segment">
<h2 class="ui header">Browsing federated tracks</h2>
<h2 class="ui header">{{ $t('Browsing federated tracks') }}</h2>
<div class="ui hidden divider"></div>
<library-track-table :show-library="true"></library-track-table>
</div>
......
......@@ -2,10 +2,10 @@
<div class="main pusher" v-title="'Instance Timeline'">
<div class="ui vertical center aligned stripe segment">
<div v-if="isLoading" :class="['ui', {'active': isLoading}, 'inverted', 'dimmer']">
<div class="ui text loader">Loading timeline...</div>
<div class="ui text loader">{{ $t('Loading timeline...') }}</div>
</div>
<div v-else class="ui text container">
<h1 class="ui header">Recent activity on this instance</h1>
<h1 class="ui header">{{ $t('Recent activity on this instance') }}</h1>
<div class="ui feed">
<component
class="event"
......
import Username from '@/components/common/Username.vue'
import { render } from '../../utils'
describe('Username', () => {
it('displays username', () => {
const vm = render(Username, {username: 'Hello'})
expect(vm.$el.textContent).to.equal('Hello')
})
})
......@@ -89,7 +89,12 @@ describe('store/auth', () => {
action: store.actions.logout,
params: {state: {}},
expectedMutations: [
{ type: 'authenticated', payload: false }
{ type: 'auth/reset', payload: null, options: {root: true} },
{ type: 'favorites/reset', payload: null, options: {root: true} },
{ type: 'player/reset', payload: null, options: {root: true} },
{ type: 'playlists/reset', payload: null, options: {root: true} },
{ type: 'queue/reset', payload: null, options: {root: true} },
{ type: 'radios/reset', payload: null, options: {root: true} }
]
}, done)
})
......@@ -107,8 +112,6 @@ describe('store/auth', () => {
action: store.actions.check,
params: {state: {token: 'test', username: 'user'}},
expectedMutations: [
{ type: 'authenticated', payload: true },
{ type: 'username', payload: 'user' },
{ type: 'token', payload: 'test' }
],
expectedActions: [
......@@ -131,9 +134,7 @@ describe('store/auth', () => {
action: store.actions.login,
payload: {credentials: credentials},
expectedMutations: [
{ type: 'token', payload: 'test' },
{ type: 'username', payload: 'bob' },
{ type: 'authenticated', payload: true }
{ type: 'token', payload: 'test' }
],
expectedActions: [
{ type: 'fetchProfile' }
......@@ -175,13 +176,14 @@ describe('store/auth', () => {
testAction({
action: store.actions.fetchProfile,
expectedMutations: [
{ type: 'authenticated', payload: true },
{ type: 'profile', payload: profile },
{ type: 'username', payload: profile.username },
{ type: 'permission', payload: {key: 'admin', status: true} }
],
expectedActions: [
{ type: 'favorites/fetch', payload: null, options: {root: true} },
{ type: 'playlists/fetchOwn', payload: null, options: {root: true} },
{ type: 'playlists/fetchOwn', payload: null, options: {root: true} }
]
}, done)
})
......
......@@ -97,6 +97,5 @@ describe('store/radios', () => {
expectedActions: []
}, done)
})
})
})
// helper for testing action with expected mutations
import Vue from 'vue'
export const render = (Component, propsData) => {
const Constructor = Vue.extend(Component)
return new Constructor({ propsData: propsData }).$mount()
}
export const testAction = ({action, payload, params, expectedMutations, expectedActions}, done) => {
let mutationsCount = 0
let actionsCount = 0
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment