fix: change page titles (#2211)

Co-authored-by: Gabriel de Perthuis <g2p.code@gmail.com>
This commit is contained in:
Nolan Lawson 2022-11-27 07:49:18 -08:00 committed by GitHub
parent 098da30f2a
commit a3f41917c7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 54 additions and 24 deletions

View file

@ -170,12 +170,12 @@ export default {
true {({count})}
other {}
}
{name}
·
{showInstanceName, select,
true {{instanceName}}
other {Pinafore}
}
·
{name}
`,
pinLabel: `{label} {pinnable, select,
true {

View file

@ -174,12 +174,12 @@ export default {
true {({count})}
other {}
}
{name}
·
{showInstanceName, select,
true {{instanceName}}
other {Pinafore}
}
·
{name}
`,
pinLabel: `{label} {pinnable, select,
true {

View file

@ -171,12 +171,12 @@ export default {
true {({count})}
other {}
}
{name}
·
{showInstanceName, select,
true {{instanceName}}
other {Pinafore}
}
·
{name}
`,
pinLabel: `{label} {pinnable, select,
true {

View file

@ -1,4 +1,5 @@
<Title name="{intl.followers}" />
<!-- TODO: this should probably be formatted as intl rather than concatenated -->
<Title name="{profileName}{intl.followers}" />
<LazyPage {pageComponent} {params} />
@ -15,6 +16,11 @@
},
data: () => ({
pageComponent
})
}),
computed: {
profileName: ({ $currentAccountProfile }) => {
return ($currentAccountProfile && ('@' + $currentAccountProfile.acct + ' · ')) || ''
}
}
}
</script>

View file

@ -1,4 +1,5 @@
<Title name="{intl.follows}" />
<!-- TODO: this should probably be formatted as intl rather than concatenated -->
<Title name="{profileName}{intl.follows}" />
<LazyPage {pageComponent} {params} />
@ -15,6 +16,11 @@
},
data: () => ({
pageComponent
})
}),
computed: {
profileName: ({ $currentAccountProfile }) => {
return ($currentAccountProfile && ('@' + $currentAccountProfile.acct + ' · ')) || ''
}
}
}
</script>

View file

@ -1,4 +1,5 @@
<Title name="{intl.profile}" />
<!-- TODO: this should probably be formatted as intl rather than concatenated -->
<Title name="{profileName}{intl.profile}" />
<LazyPage {pageComponent} {params} />
@ -15,6 +16,11 @@
},
data: () => ({
pageComponent
})
}),
computed: {
profileName: ({ $currentAccountProfile }) => {
return ($currentAccountProfile && ('@' + $currentAccountProfile.acct + ' · ')) || ''
}
}
}
</script>

View file

@ -1,4 +1,5 @@
<Title name="{intl.profileWithMedia}" />
<!-- TODO: this should probably be formatted as intl rather than concatenated -->
<Title name="{profileName}{intl.profileWithMedia}" />
<LazyPage {pageComponent} {params} />
@ -15,6 +16,11 @@
},
data: () => ({
pageComponent
})
}),
computed: {
profileName: ({ $currentAccountProfile }) => {
return ($currentAccountProfile && ('@' + $currentAccountProfile.acct + ' · ')) || ''
}
}
}
</script>

View file

@ -1,4 +1,5 @@
<Title name="{intl.profileWithReplies}" />
<!-- TODO: this should probably be formatted as intl rather than concatenated -->
<Title name="{profileName}{intl.profileWithReplies}" />
<LazyPage {pageComponent} {params} />
@ -15,6 +16,11 @@
},
data: () => ({
pageComponent
})
}),
computed: {
profileName: ({ $currentAccountProfile }) => {
return ($currentAccountProfile && ('@' + $currentAccountProfile.acct + ' · ')) || ''
}
}
}
</script>

View file

@ -12,7 +12,7 @@ test('shows unread notification', async t => {
await loginAsFoobar(t)
await t
.expect(notificationsNavButton.getAttribute('aria-label')).eql('Notifications')
.expect(getTitleText()).eql('localhost:3000 · Home')
.expect(getTitleText()).eql('Home · localhost:3000')
.expect(getNthStatusContent(1).innerText).contains('somebody please favorite this to validate me', {
timeout: 20000
})
@ -21,17 +21,17 @@ test('shows unread notification', async t => {
.expect(notificationsNavButton.getAttribute('aria-label')).eql('Notifications (1 notification)', {
timeout: 20000
})
.expect(getTitleText()).eql('(1) localhost:3000 · Home')
.expect(getTitleText()).eql('(1) Home · localhost:3000')
.click(notificationsNavButton)
.expect(getUrl()).contains('/notifications')
.expect(notificationsNavButton.getAttribute('aria-label')).eql('Notifications (current page)')
.expect(getTitleText()).eql('localhost:3000 · Notifications')
.expect(getTitleText()).eql('Notifications · localhost:3000')
.expect(getNthStatus(1).innerText).contains('somebody please favorite this to validate me')
.expect(getNthStatus(1).innerText).match(/admin\s+favorited your toot/)
await t
.click(homeNavButton)
.expect(notificationsNavButton.getAttribute('aria-label')).eql('Notifications')
.expect(getTitleText()).eql('localhost:3000 · Home')
.expect(getTitleText()).eql('Home · localhost:3000')
})
test('shows unread notifications, more than one', async t => {
@ -39,7 +39,7 @@ test('shows unread notifications, more than one', async t => {
await loginAsFoobar(t)
await t
.expect(notificationsNavButton.getAttribute('aria-label')).eql('Notifications')
.expect(getTitleText()).eql('localhost:3000 · Home')
.expect(getTitleText()).eql('Home · localhost:3000')
.expect(getNthStatusContent(1).innerText).contains('I need lots of favorites on this one', {
timeout: 20000
})
@ -49,14 +49,14 @@ test('shows unread notifications, more than one', async t => {
.expect(notificationsNavButton.getAttribute('aria-label')).eql('Notifications (2 notifications)', {
timeout: 20000
})
.expect(getTitleText()).eql('(2) localhost:3000 · Home')
.expect(getTitleText()).eql('(2) Home · localhost:3000')
.click(notificationsNavButton)
.expect(getUrl()).contains('/notifications')
.expect(notificationsNavButton.getAttribute('aria-label')).eql('Notifications (current page)')
.expect(getTitleText()).eql('localhost:3000 · Notifications')
.expect(getTitleText()).eql('Notifications · localhost:3000')
.expect(getNthStatus(1).innerText).contains('I need lots of favorites on this one')
await t
.click(homeNavButton)
.expect(notificationsNavButton.getAttribute('aria-label')).eql('Notifications')
.expect(getTitleText()).eql('localhost:3000 · Home')
.expect(getTitleText()).eql('Home · localhost:3000')
})