Skip to content

Commit

Permalink
update tests to improve image removal descriptions and add new effect…
Browse files Browse the repository at this point in the history
… operations
  • Loading branch information
BlackRam-oss committed Nov 19, 2024
1 parent 3ce1312 commit 3240eb2
Showing 1 changed file with 115 additions and 4 deletions.
119 changes: 115 additions & 4 deletions tests/pixivn-features.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,7 @@ test('remove image', async () => {
{
type: "oprationtoconvert",
values: [
"remove image bg dissolve",
"remove image bg with dissolve",
],
},
],
Expand All @@ -413,7 +413,7 @@ test('remove image', async () => {
{
type: "oprationtoconvert",
values: [
"remove image bg dissolve duration 3",
"remove image bg with dissolve duration 3",
],
},
],
Expand Down Expand Up @@ -495,8 +495,8 @@ test('remove image', async () => {
=== start
#remove image bg
#remove image "bg 2"
#remove image bg dissolve
#remove image bg dissolve duration 3
#remove image bg with dissolve
#remove image bg with dissolve duration 3
Hello
-> DONE
`);
Expand All @@ -505,6 +505,117 @@ Hello
expect(res).toEqual(expected2);
});

test('effect image', async () => {
let expected1: PixiVNJson = {
labels: {
start: [
{
operations: [
{
type: "oprationtoconvert",
values: [
"move bg destination { \"x\": 20, \"y\": 30 }",
],
},
],
goNextStep: true,
},
{
operations: [
{
type: "oprationtoconvert",
values: [
"shake bg",
],
},
],
goNextStep: true,
},
{
operations: [
{
type: "oprationtoconvert",
values: [
"rotate bg clockwise true",
],
},
],
goNextStep: true,
},
{
dialogue: undefined,
},
{
end: "label_end",
goNextStep: true,
},
],
}
}
let expected2: PixiVNJson = {
labels: {
start: [
{
operations: [
{
alias: "bg",
type: "move",
props: {
destination: {
x: 20,
y: 30,
},
},
},
],
goNextStep: true,
},
{
operations: [
{
alias: "bg",
type: "shake",
props: {
},
},
],
goNextStep: true,
},
{
operations: [
{
alias: "bg",
type: "rotate",
props: {
clockwise: true,
},
},
],
goNextStep: true,
},
{
dialogue: undefined,
},
{
end: "label_end",
goNextStep: true,
},
],
}
}
let res = convertInkText(`
=== start
# move bg destination \\\{ "x": 20, "y": 30 \\\}
# shake bg
# rotate bg clockwise true
# pause
-> DONE
`);
expect(res).toEqual(expected1);
await convertOperation(res);
expect(res).toEqual(expected2);
});

/**
* Video
*/
Expand Down

0 comments on commit 3240eb2

Please sign in to comment.