mirror of
https://github.com/go-vikunja/vikunja.git
synced 2026-04-30 16:28:23 -05:00
feat(kanban): add setting to always show bucket task count (#1966)
Added "Always show task count on Kanban buckets" setting in user preferences to control the visibility of task counts on Kanban bucket headers
This commit is contained in:
@@ -4,8 +4,9 @@ import {TEST_PASSWORD} from './constants'
|
||||
|
||||
/**
|
||||
* This authenticates a user and puts the token in local storage which allows us to perform authenticated requests.
|
||||
* Returns the user and token for use in tests that need to make authenticated API calls.
|
||||
*/
|
||||
export async function login(page: Page, apiContext: APIRequestContext, user?: any) {
|
||||
export async function login(page: Page | null, apiContext: APIRequestContext, user?: any) {
|
||||
if (!user) {
|
||||
throw new Error('Needs user')
|
||||
}
|
||||
@@ -25,12 +26,14 @@ export async function login(page: Page, apiContext: APIRequestContext, user?: an
|
||||
const body = await response.json()
|
||||
const token = body.token
|
||||
|
||||
// Set token in localStorage before navigating
|
||||
await page.addInitScript((token) => {
|
||||
window.localStorage.setItem('token', token)
|
||||
}, token)
|
||||
// Set token in localStorage before navigating (only if page is provided)
|
||||
if (page) {
|
||||
await page.addInitScript((token) => {
|
||||
window.localStorage.setItem('token', token)
|
||||
}, token)
|
||||
}
|
||||
|
||||
return user
|
||||
return {user, token}
|
||||
}
|
||||
|
||||
export async function createFakeUser() {
|
||||
|
||||
Reference in New Issue
Block a user