-
-
Notifications
You must be signed in to change notification settings - Fork 234
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #879 from runtipi/release/2.1.0
Release 2.1.0
- Loading branch information
Showing
77 changed files
with
1,915 additions
and
1,154 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
import { test, expect } from '@playwright/test'; | ||
import { appTable } from '@/server/db/schema'; | ||
import { setSettings } from './helpers/settings'; | ||
import { loginUser } from './fixtures/fixtures'; | ||
import { clearDatabase, db } from './helpers/db'; | ||
|
||
test.beforeEach(async () => { | ||
await clearDatabase(); | ||
await setSettings({}); | ||
}); | ||
|
||
test('user can activate the guest dashboard and see it when logged out', async ({ page }) => { | ||
await loginUser(page); | ||
await page.goto('/settings'); | ||
|
||
await page.getByRole('tab', { name: 'Settings' }).click(); | ||
await page.getByLabel('guestDashboard').setChecked(true); | ||
await page.getByRole('button', { name: 'Save' }).click(); | ||
await page.getByTestId('logout-button').click(); | ||
|
||
await expect(page.getByText('No apps to display')).toBeVisible(); | ||
}); | ||
|
||
test('logged out users can see the apps on the guest dashboard', async ({ browser }) => { | ||
await setSettings({ guestDashboard: true }); | ||
await db.insert(appTable).values({ config: {}, isVisibleOnGuestDashboard: true, id: 'hello-world', exposed: true, domain: 'duckduckgo.com', status: 'running' }); | ||
await db.insert(appTable).values({ config: {}, isVisibleOnGuestDashboard: false, id: 'actual-budget', exposed: false, status: 'running' }); | ||
|
||
const context = await browser.newContext(); | ||
const page = await context.newPage(); | ||
await page.goto('/'); | ||
await expect(page.getByText(/Hello World web server/)).toBeVisible(); | ||
const locator = page.locator('text=Actual Budget'); | ||
expect(locator).not.toBeVisible(); | ||
|
||
const [newPage] = await Promise.all([context.waitForEvent('page'), await page.getByRole('link', { name: /Hello World/ }).click()]); | ||
|
||
await newPage.waitForLoadState(); | ||
expect(newPage.url()).toBe('https://duckduckgo.com/'); | ||
await newPage.close(); | ||
|
||
await context.close(); | ||
}); | ||
|
||
test('user can deactivate the guest dashboard and not see it when logged out', async ({ page }) => { | ||
await loginUser(page); | ||
await page.goto('/settings'); | ||
|
||
await page.getByRole('tab', { name: 'Settings' }).click(); | ||
await page.getByLabel('guestDashboard').setChecked(false); | ||
await page.getByRole('button', { name: 'Save' }).click(); | ||
await page.getByTestId('logout-button').click(); | ||
|
||
await page.goto('/'); | ||
|
||
// We should be redirected to the login page | ||
await expect(page.getByRole('heading', { name: 'Login' })).toBeVisible(); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,12 @@ | ||
import { clearDatabase } from './db'; | ||
import { setSettings } from './settings'; | ||
|
||
/** | ||
* | ||
*/ | ||
async function globalSetup() { | ||
await clearDatabase(); | ||
await setSettings({}); | ||
} | ||
|
||
export default globalSetup; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import { promises } from 'fs'; | ||
import path from 'path'; | ||
import { z } from 'zod'; | ||
import { settingsSchema } from '@runtipi/shared'; | ||
|
||
export const setSettings = async (settings: z.infer<typeof settingsSchema>) => { | ||
await promises.writeFile(path.join(__dirname, '../../state/settings.json'), JSON.stringify(settings)); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,5 @@ | ||
/// <reference types="next" /> | ||
/// <reference types="next/image-types/global" /> | ||
/// <reference types="next/navigation-types/compat/navigation" /> | ||
|
||
// NOTE: This file should not be edited | ||
// see https://nextjs.org/docs/basic-features/typescript for more information. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.