fead: group member moderation ban export/import dialog (#1675)

This commit is contained in:
pa
2026-03-05 20:37:05 +09:00
parent 0034f7847b
commit b570de6d4a
12 changed files with 1353 additions and 574 deletions

View File

@@ -1,4 +1,5 @@
import {
generateEmojiStyle,
getEmojiFileName,
getPrintFileName,
getPrintLocalDate
@@ -311,4 +312,47 @@ describe('Gallery Utils', () => {
});
});
});
describe('generateEmojiStyle', () => {
test('returns CSS with background url and animation', () => {
const style = generateEmojiStyle(
'https://example.com/emoji.png',
10,
4,
'linear',
100
);
expect(style).toContain("url('https://example.com/emoji.png')");
expect(style).toContain('animation:');
expect(style).toContain('steps(1)');
});
test('uses 2 framesPerLine for frameCount <= 4', () => {
const style = generateEmojiStyle('u', 10, 4, 'linear', 100);
// frameSize = 1024/2 = 512
expect(style).toContain('512px');
});
test('uses 4 framesPerLine for frameCount 5-16', () => {
const style = generateEmojiStyle('u', 10, 8, 'linear', 100);
// frameSize = 1024/4 = 256
expect(style).toContain('256px');
});
test('uses 8 framesPerLine for frameCount > 16', () => {
const style = generateEmojiStyle('u', 10, 20, 'linear', 100);
// frameSize = 1024/8 = 128
expect(style).toContain('128px');
});
test('uses alternate for pingpong loopStyle', () => {
const style = generateEmojiStyle('u', 10, 4, 'pingpong', 100);
expect(style).toContain('alternate');
});
test('uses none for non-pingpong loopStyle', () => {
const style = generateEmojiStyle('u', 10, 4, 'linear', 100);
expect(style).toMatch(/\bnone\b/);
});
});
});