Skip to content

Commit 6b32005

Browse files
committed
test: add unit tests for buildTransformationString function
1 parent 42345c3 commit 6b32005

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
const { buildTransformationString } = require("../../src/index");
2+
const { expect } = require('chai');
3+
4+
describe('buildTransformationString', function () {
5+
it('should return an empty string when no transformations are provided', function () {
6+
const result = buildTransformationString([{}]);
7+
expect(result).to.equal('');
8+
});
9+
10+
it('should generate a transformation string for width only', function () {
11+
const result = buildTransformationString([{ width: 300 }]);
12+
expect(result).to.equal('w-300');
13+
});
14+
15+
it('should generate a transformation string for multiple transformations', function () {
16+
const result = buildTransformationString([
17+
{
18+
overlay: {
19+
type: 'text',
20+
text: 'Hello',
21+
}
22+
}
23+
]);
24+
expect(result).to.equal('l-text,i-Hello,l-end');
25+
});
26+
});

0 commit comments

Comments
 (0)