Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@
<v-card>
<v-card-title>Status information</v-card-title>
<v-card-text v-if="!hasPendingReview">
Under our <ExternalLink :url="`https://www.wikibase.cloud/hosting-policy`">hosting policy</ExternalLink>, 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 <ExternalLink :url="`https://www.wikibase.cloud/wikis/manage/${this.wikiId}/review`">submit it for review</ExternalLink>.
Under our <ExternalLink :url="`https://www.wikibase.cloud/hosting-policy`">hosting policy</ExternalLink>, Wikibases are temporary by default. Unless submitted for review, your Wikibase <strong>{{ wikiDomain }}</strong> will be taken offline on {{ formattedActiveFromDate }}. If you want to keep it online, please <ExternalLink :url="`https://www.wikibase.cloud/wikis/manage/${this.wikiId}/review`">submit it for review</ExternalLink>.
</v-card-text>
<v-card-text v-if="hasPendingReview">
Your Wikibase <strong>{{ wikiDomain }}</strong> 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.
</v-card-text>
<v-divider />
<v-card-actions class="justify-end">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
</v-chip>
<v-chip
v-else
@click="expandDialog = true"
class="ml-3 px-2"
color="primary"
:outlined="!hover"
Expand Down
45 changes: 45 additions & 0 deletions tests/unit/WikiDashboardListDialogContent.spec.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
import { shallowMount } from '@vue/test-utils'
import WikiDashboardListDialogContent from '@/components/Pages/Dashboard/Components/WikiDashboardListDialogContent.vue'
require('./boilerplate.js')

describe('WikiDashboardListDialogContent.vue', () => {
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')
})
})
Loading