Add `DEVIN_MODE` configuration supporting `enterprise` (default) and `organization_sessions` modes. Organization sessions mode uses `/v3/organizations/{org_id}/sessions` API with `ViewOrgSessions` permission, suitable for non-Enterprise organizations. Sums session ACUs consumed within configurable rolling window (1-365 days via `DEVIN_SESSION_WINDOW_DAYS`). Mode does not show quota, percentage, credit, or reset fields as these are unav
21 lines
772 B
Python
21 lines
772 B
Python
from pathlib import Path
|
|
|
|
|
|
ROOT = Path(__file__).parents[1]
|
|
|
|
|
|
def test_frontend_assets_exist_and_use_api():
|
|
html = (ROOT / 'templates/index.html').read_text()
|
|
script = (ROOT / 'static/app.js').read_text()
|
|
css = (ROOT / 'static/style.css').read_text()
|
|
assert '/static/style.css' in html
|
|
assert '/static/app.js' in html
|
|
assert "fetch('/api/usage'" in script
|
|
assert 'entry.id === limit.id' in script
|
|
assert 'requestAnimationFrame' in script
|
|
assert "if (limit.used != null) return `${fmt(limit.used)} ${limit.unit || ''}`.trim();" in script
|
|
assert "meta.classList.add('standalone')" in script
|
|
assert '.meta.standalone .amount' in css
|
|
assert 'font-size: clamp(24px, 2.2vw, 34px)' in css
|
|
assert 'grid-template-columns' in css
|