18 lines
685 B
JavaScript
18 lines
685 B
JavaScript
|
|
import assert from 'node:assert/strict';
|
||
|
|
import test from 'node:test';
|
||
|
|
import { interactionInternals } from './plaza-interactions.mjs';
|
||
|
|
|
||
|
|
test('normalizeReactionType accepts like collect share', () => {
|
||
|
|
assert.equal(interactionInternals.normalizeReactionType('like'), 'like');
|
||
|
|
assert.equal(interactionInternals.normalizeReactionType('collect'), 'collect');
|
||
|
|
assert.throws(
|
||
|
|
() => interactionInternals.normalizeReactionType('love'),
|
||
|
|
(error) => error.code === 'invalid_input',
|
||
|
|
);
|
||
|
|
});
|
||
|
|
|
||
|
|
test('clampLimit matches plaza posts helper behavior', () => {
|
||
|
|
assert.equal(interactionInternals.clampLimit(undefined), 20);
|
||
|
|
assert.equal(interactionInternals.clampLimit(100), 50);
|
||
|
|
});
|