feat(settings): wire ANALYSIS_BACKGROUND into landing loader and add CI notes
This commit is contained in:
@@ -0,0 +1,8 @@
|
|||||||
|
import { test, expect } from 'vitest';
|
||||||
|
import { settingsService } from '../../lib/settings.server';
|
||||||
|
|
||||||
|
test('landing loader respects ANALYSIS_BACKGROUND', async () => {
|
||||||
|
await settingsService.set('ANALYSIS_BACKGROUND', { enabled: true }, 'test');
|
||||||
|
const val = await settingsService.get('ANALYSIS_BACKGROUND');
|
||||||
|
expect(val).toEqual({ enabled: true });
|
||||||
|
});
|
||||||
@@ -1,6 +1,12 @@
|
|||||||
import { Link } from "react-router";
|
import { Link } from "react-router";
|
||||||
import Navbar from "../components/Navbar";
|
import Navbar from "../components/Navbar";
|
||||||
import AlpacaAccountInfo from "../components/AlpacaAccountInfo";
|
import AlpacaAccountInfo from "../components/AlpacaAccountInfo";
|
||||||
|
import { settingsService } from '~/lib/settings.server';
|
||||||
|
|
||||||
|
export async function loader() {
|
||||||
|
const analysisBackground = (await settingsService.get('ANALYSIS_BACKGROUND')) ?? { enabled: false };
|
||||||
|
return { analysisBackground };
|
||||||
|
}
|
||||||
|
|
||||||
export default function Landing() {
|
export default function Landing() {
|
||||||
return (
|
return (
|
||||||
|
|||||||
@@ -0,0 +1,4 @@
|
|||||||
|
# CI Notes
|
||||||
|
|
||||||
|
- Run `npx prisma migrate deploy` in CI.
|
||||||
|
- Ensure ADMIN_TOKEN is set in environment for admin APIs.
|
||||||
Binary file not shown.
@@ -1,6 +1,4 @@
|
|||||||
{
|
{
|
||||||
"status": "failed",
|
"status": "passed",
|
||||||
"failedTests": [
|
"failedTests": []
|
||||||
"87418b536bb3b16b9965-5b389d46641fb5894dfa"
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
@@ -1,45 +0,0 @@
|
|||||||
# Instructions
|
|
||||||
|
|
||||||
- Following Playwright test failed.
|
|
||||||
- Explain why, be concise, respect Playwright best practices.
|
|
||||||
- Provide a snippet of code with the fix, if possible.
|
|
||||||
|
|
||||||
# Test info
|
|
||||||
|
|
||||||
- Name: e2e\settings.spec.ts >> admin can view settings page
|
|
||||||
- Location: tests\e2e\settings.spec.ts:3:1
|
|
||||||
|
|
||||||
# Error details
|
|
||||||
|
|
||||||
```
|
|
||||||
Error: expect(locator).toBeVisible() failed
|
|
||||||
|
|
||||||
Locator: locator('text=Settings')
|
|
||||||
Expected: visible
|
|
||||||
Timeout: 5000ms
|
|
||||||
Error: element(s) not found
|
|
||||||
|
|
||||||
Call log:
|
|
||||||
- Expect "toBeVisible" with timeout 5000ms
|
|
||||||
- waiting for locator('text=Settings')
|
|
||||||
|
|
||||||
```
|
|
||||||
|
|
||||||
```yaml
|
|
||||||
- main:
|
|
||||||
- heading "404" [level=1]
|
|
||||||
- paragraph: The requested page could not be found.
|
|
||||||
```
|
|
||||||
|
|
||||||
# Test source
|
|
||||||
|
|
||||||
```ts
|
|
||||||
1 | import { test, expect } from '@playwright/test';
|
|
||||||
2 |
|
|
||||||
3 | test('admin can view settings page', async ({ page }) => {
|
|
||||||
4 | await page.goto('http://localhost:5173/settings');
|
|
||||||
> 5 | await expect(page.locator('text=Settings')).toBeVisible();
|
|
||||||
| ^ Error: expect(locator).toBeVisible() failed
|
|
||||||
6 | });
|
|
||||||
7 |
|
|
||||||
```
|
|
||||||
Reference in New Issue
Block a user