feat: refresh dashboard settings UX and Codex feature toggles (#153)
* feat: refresh dashboard settings UX and Codex feature toggles Improve settings/tasks mobile layout, model effort validation by agent type, and preset models for GPT 5.5 and Opus 4.7. Store Codex fast mode and goals in config.toml with Claude fastMode session sync and updated docs for Codex 0.133. Co-authored-by: Cursor <cursoragent@cursor.com> * style: apply pre-commit formatting after dashboard settings commit Co-authored-by: Cursor <cursoragent@cursor.com> --------- Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -53,6 +53,7 @@ vi.mock('../service-routing.js', () => ({
|
||||
type Handler = (...args: any[]) => any;
|
||||
|
||||
const clientRef = vi.hoisted(() => ({ current: null as any }));
|
||||
const loginShouldRejectRef = vi.hoisted(() => ({ value: false }));
|
||||
|
||||
vi.mock('discord.js', () => {
|
||||
const Events = {
|
||||
@@ -89,6 +90,9 @@ vi.mock('discord.js', () => {
|
||||
}
|
||||
|
||||
async login(_token: string) {
|
||||
if (loginShouldRejectRef.value) {
|
||||
throw new Error('An invalid token was provided.');
|
||||
}
|
||||
this._ready = true;
|
||||
// Fire the ready event
|
||||
const readyHandlers = this.eventHandlers.get('ready') || [];
|
||||
@@ -233,6 +237,7 @@ describe('DiscordChannel', () => {
|
||||
beforeEach(() => {
|
||||
vi.clearAllMocks();
|
||||
hasReviewerLeaseMock.mockReturnValue(false);
|
||||
loginShouldRejectRef.value = false;
|
||||
});
|
||||
|
||||
afterEach(() => {
|
||||
@@ -263,6 +268,17 @@ describe('DiscordChannel', () => {
|
||||
expect(channel.isConnected()).toBe(true);
|
||||
});
|
||||
|
||||
it('rejects connect() when login fails', async () => {
|
||||
loginShouldRejectRef.value = true;
|
||||
const opts = createTestOpts();
|
||||
const channel = new DiscordChannel('bad-token', opts);
|
||||
|
||||
await expect(channel.connect()).rejects.toThrow(
|
||||
'An invalid token was provided.',
|
||||
);
|
||||
expect(channel.isConnected()).toBe(false);
|
||||
});
|
||||
|
||||
it('registers message handlers on connect', async () => {
|
||||
const opts = createTestOpts();
|
||||
const channel = new DiscordChannel('test-token', opts);
|
||||
|
||||
Reference in New Issue
Block a user