diff --git a/client/src/__tests__/utils/factories/richTextFactory.ts b/client/src/__tests__/utils/factories/richTextFactory.ts new file mode 100644 index 00000000..b8f5da8f --- /dev/null +++ b/client/src/__tests__/utils/factories/richTextFactory.ts @@ -0,0 +1,66 @@ +import { RichText, TextStyle } from '@shared/dtos' +import Factory from '@tests/utils/factories/factory' + +export default class RichTextFactory extends Factory { + protected state: RichText = { + type: 'text', + text: { + content: 'The', + link: null, + }, + annotations: { + bold: false, + italic: false, + strikethrough: false, + underline: false, + code: false, + color: 'default', + }, + plain_text: 'The', + href: null, + } + + public text (text: string): RichTextFactory { + this.state.text.content = text + this.state.plain_text = text + + return this + } + + public bold (): RichTextFactory { + this.state.annotations.bold = true + + return this + } + + + public italic (): RichTextFactory { + this.state.annotations.italic = true + + return this + } + + public strikethrough (): RichTextFactory { + this.state.annotations.strikethrough = true + + return this + } + + public underline (): RichTextFactory { + this.state.annotations.underline = true + + return this + } + + public code (): RichTextFactory { + this.state.annotations.code = true + + return this + } + + public color (color: TextStyle['color']): RichTextFactory { + this.state.annotations.color = color + + return this + } +} diff --git a/client/src/__tests__/utils/factories/weekFactory.ts b/client/src/__tests__/utils/factories/weekFactory.ts index b98cd83c..2b8822ab 100644 --- a/client/src/__tests__/utils/factories/weekFactory.ts +++ b/client/src/__tests__/utils/factories/weekFactory.ts @@ -9,6 +9,7 @@ export default class WeekFactory extends Factory { date: '2020-01-01', isSkipped: false, slug: null, + styledTheme: [], movies: [], } diff --git a/client/src/components/WeekItem.vue b/client/src/components/WeekItem.vue index fe416ea8..15b91cca 100644 --- a/client/src/components/WeekItem.vue +++ b/client/src/components/WeekItem.vue @@ -4,15 +4,12 @@ import { WeekDto } from '@shared/dtos' import { rsvpModal } from '@client/state/modalState' import MovieList from '@components/MovieList.vue' import SkippedBanner from '@components/SkippedBanner.vue' +import Theme from '@components/week/Theme.vue' defineProps<{ week: WeekDto showEventDetails: boolean }>() - -const weekTitle = (week: WeekDto) => { - return week.isSkipped ? 'No movies this week!' : week.theme -}