diff --git a/src/components/Pages/Dashboard/Components/WikiDashboardListDialogContent.vue b/src/components/Pages/Dashboard/Components/WikiDashboardListDialogContent.vue index 32cfedc5..c82de7ea 100644 --- a/src/components/Pages/Dashboard/Components/WikiDashboardListDialogContent.vue +++ b/src/components/Pages/Dashboard/Components/WikiDashboardListDialogContent.vue @@ -2,7 +2,10 @@ Status information - Under our hosting policy, Wikibases are temporary by default. Unless submitted for review, your Wikibase {{ wikiDomain }} will be taken offline on {{ formattedActiveFromDate }}. If you want to keep it online, please submit it for review. + Under our hosting policy, Wikibases are temporary by default. Unless submitted for review, your Wikibase {{ wikiDomain }} will be taken offline on {{ formattedActiveFromDate }}. If you want to keep it online, please submit it for review. + + + Your Wikibase {{ wikiDomain }} is expecting a review. Once it's reviewed, we'll let you know the outcome and what happens next. The Wikibase will stay online at least until the review is complete. diff --git a/src/components/Pages/Dashboard/Components/WikiDashboardListElement.vue b/src/components/Pages/Dashboard/Components/WikiDashboardListElement.vue index a6c5c636..4b41e497 100644 --- a/src/components/Pages/Dashboard/Components/WikiDashboardListElement.vue +++ b/src/components/Pages/Dashboard/Components/WikiDashboardListElement.vue @@ -16,6 +16,7 @@ { + const today = new Date() + const suspensionDay = today.getDate() + 1 + const suspensionActiveFromDate = new Date() + suspensionActiveFromDate.setDate(suspensionDay) + const formattedActiveFromDate = suspensionActiveFromDate.toLocaleDateString( + 'en-GB', + { year: 'numeric', month: 'long', day: 'numeric', timeZone: 'UTC' }, + ) + const propsData = { + formattedActiveFromDate, + wikiDomain: 'mywayordatway.wikibase.cloud', + wikiId: 1, + } + + it('renders the expiry message when there is no pending review', () => { + const wrapper = shallowMount(WikiDashboardListDialogContent, { + propsData: { + ...propsData, + hasPendingReview: false, + }, + }) + + expect(wrapper.text()).toContain(`will be taken offline on ${formattedActiveFromDate}`) + expect(wrapper.text()).not.toContain('is expecting a review') + expect(wrapper.text()).toContain('mywayordatway.wikibase.cloud') + }) + + it('renders the pending review message when a review is pending', () => { + const wrapper = shallowMount(WikiDashboardListDialogContent, { + propsData: { + ...propsData, + hasPendingReview: true, + }, + }) + + expect(wrapper.text()).toContain('is expecting a review') + expect(wrapper.text()).not.toContain('will be taken offline') + expect(wrapper.text()).toContain('mywayordatway.wikibase.cloud') + }) +})