mirror of
https://github.com/bulwarkmail/webmail.git
synced 2026-11-04 16:14:07 +00:00
The folder menu tests no longer expect "Empty folder" on a folder of your own: emptying is offered on Trash and Spam only now. The Mountain View list test expects the entry to read "Empty Trash".
29 lines
1.2 KiB
TypeScript
29 lines
1.2 KiB
TypeScript
import { describe, expect, it } from 'vitest';
|
|
import { emptyFolderLabelKey, emptyFolderPrompt } from '../empty-folder-text';
|
|
|
|
// p2-14: the confirm said "All emails in this folder will be permanently
|
|
// deleted" with no number; it now says how many, and names Trash or Spam.
|
|
|
|
describe('emptyFolderPrompt', () => {
|
|
it('names Trash and counts its messages', () => {
|
|
expect(emptyFolderPrompt({ role: 'trash', totalEmails: 146 }, false)).toEqual({
|
|
title: 'mail_p2_folders.empty_trash',
|
|
message: 'mail_p2_folders.empty_trash_confirm',
|
|
values: { count: 146 },
|
|
confirm: 'mail_p2_folders.empty_trash',
|
|
});
|
|
});
|
|
|
|
it('names Spam and counts its messages', () => {
|
|
const prompt = emptyFolderPrompt({ role: 'junk', totalEmails: 3 }, false);
|
|
expect(prompt.title).toBe('mail_p2_folders.empty_spam');
|
|
expect(prompt.message).toBe('mail_p2_folders.empty_spam_confirm');
|
|
expect(prompt.values).toEqual({ count: 3 });
|
|
});
|
|
|
|
it('keeps the old wording for other folders', () => {
|
|
expect(emptyFolderPrompt({ role: null, totalEmails: 3 }, true).message).toBe('email_list.empty_folder.confirm_message_trash');
|
|
expect(emptyFolderLabelKey('inbox')).toBeNull();
|
|
});
|
|
});
|