diff --git a/resources/assets/js/__tests__/factory/index.ts b/resources/assets/js/__tests__/factory/index.ts index 5e3bd4cb..b9bd293d 100644 --- a/resources/assets/js/__tests__/factory/index.ts +++ b/resources/assets/js/__tests__/factory/index.ts @@ -3,6 +3,7 @@ import artistFactory, { states as artistStates } from '@/__tests__/factory/artis import songFactory, { states as songStates } from '@/__tests__/factory/songFactory' import albumFactory, { states as albumStates } from './albumFactory' import smartPlaylistRuleFactory from '@/__tests__/factory/smartPlaylistRuleFactory' +import smartPlaylistRuleGroupFactory from '@/__tests__/factory/smartPlaylistRuleGroupFactory' import playlistFactory, { states as playlistStates } from '@/__tests__/factory/playlistFactory' import userFactory, { states as userStates } from '@/__tests__/factory/userFactory' import albumTrackFactory from '@/__tests__/factory/albumTrackFactory' @@ -10,7 +11,7 @@ import albumInfoFactory from '@/__tests__/factory/albumInfoFactory' import artistInfoFactory from '@/__tests__/factory/artistInfoFactory' import youTubeVideoFactory from '@/__tests__/factory/youTubeVideoFactory' -factory +export default factory .define('artist', faker => artistFactory(faker), artistStates) .define('artist-info', faker => artistInfoFactory(faker)) .define('album', faker => albumFactory(faker), albumStates) @@ -19,7 +20,6 @@ factory .define('song', faker => songFactory(faker), songStates) .define('video', faker => youTubeVideoFactory(faker)) .define('smart-playlist-rule', faker => smartPlaylistRuleFactory(faker)) + .define('smart-playlist-rule-group', faker => smartPlaylistRuleGroupFactory(faker)) .define('playlist', faker => playlistFactory(faker), playlistStates) .define('user', faker => userFactory(faker), userStates) - -export default factory diff --git a/resources/assets/js/__tests__/factory/smartPlaylistRuleGroupFactory.ts b/resources/assets/js/__tests__/factory/smartPlaylistRuleGroupFactory.ts new file mode 100644 index 00000000..9c38e3c0 --- /dev/null +++ b/resources/assets/js/__tests__/factory/smartPlaylistRuleGroupFactory.ts @@ -0,0 +1,7 @@ +import { Faker } from '@faker-js/faker' +import factory from 'factoria' + +export default (faker: Faker): SmartPlaylistRuleGroup => ({ + id: faker.datatype.number(), + rules: factory('smart-playlist-rule', 3) +}) diff --git a/resources/assets/js/components/playlist/PlaylistNameEditor.vue b/resources/assets/js/components/playlist/PlaylistNameEditor.vue index c67ca99a..9bdcfc80 100644 --- a/resources/assets/js/components/playlist/PlaylistNameEditor.vue +++ b/resources/assets/js/components/playlist/PlaylistNameEditor.vue @@ -1,6 +1,6 @@