Remove debug code from the integration tests
Doing so simplifies the code a bit, and such code is generally not checked in because it can easily be added locally if needed.
This commit is contained in:
parent
35f85c55bd
commit
efe4a3455a
@ -1388,15 +1388,10 @@ describe("Stamp Editor", () => {
|
|||||||
|
|
||||||
await Promise.all(
|
await Promise.all(
|
||||||
pages.map(async ([browserName, page]) => {
|
pages.map(async ([browserName, page]) => {
|
||||||
const debug = false;
|
|
||||||
|
|
||||||
await page.click("#secondaryToolbarToggleButton");
|
await page.click("#secondaryToolbarToggleButton");
|
||||||
await page.waitForSelector("#secondaryToolbar", { visible: true });
|
await page.waitForSelector("#secondaryToolbar", { visible: true });
|
||||||
const secondary = await page.$("#secondaryToolbar");
|
const secondary = await page.$("#secondaryToolbar");
|
||||||
const png = await secondary.screenshot({
|
const png = await secondary.screenshot({ type: "png" });
|
||||||
type: "png",
|
|
||||||
path: debug ? `foo.png` : "",
|
|
||||||
});
|
|
||||||
const secondaryImage = PNG.sync.read(Buffer.from(png));
|
const secondaryImage = PNG.sync.read(Buffer.from(png));
|
||||||
const buffer = new Uint32Array(secondaryImage.data.buffer);
|
const buffer = new Uint32Array(secondaryImage.data.buffer);
|
||||||
expect(buffer.every(x => x === 0xff0000ff))
|
expect(buffer.every(x => x === 0xff0000ff))
|
||||||
|
|||||||
@ -400,8 +400,6 @@ describe("PDF viewer", () => {
|
|||||||
it("must check that canvas perfectly fits the page whatever the zoom level is", async () => {
|
it("must check that canvas perfectly fits the page whatever the zoom level is", async () => {
|
||||||
await Promise.all(
|
await Promise.all(
|
||||||
pages.map(async ([browserName, page]) => {
|
pages.map(async ([browserName, page]) => {
|
||||||
const debug = false;
|
|
||||||
|
|
||||||
// The pdf has a single page with a red background.
|
// The pdf has a single page with a red background.
|
||||||
// We set the viewer background to red, because when screenshoting
|
// We set the viewer background to red, because when screenshoting
|
||||||
// some part of the viewer background can be visible.
|
// some part of the viewer background can be visible.
|
||||||
@ -426,10 +424,7 @@ describe("PDF viewer", () => {
|
|||||||
await scrollIntoView(page, `.page[data-page-number="1"]`);
|
await scrollIntoView(page, `.page[data-page-number="1"]`);
|
||||||
|
|
||||||
const element = await page.$(`.page[data-page-number="1"]`);
|
const element = await page.$(`.page[data-page-number="1"]`);
|
||||||
const png = await element.screenshot({
|
const png = await element.screenshot({ type: "png" });
|
||||||
type: "png",
|
|
||||||
path: debug ? `foo${i}.png` : "",
|
|
||||||
});
|
|
||||||
const pageImage = PNG.sync.read(Buffer.from(png));
|
const pageImage = PNG.sync.read(Buffer.from(png));
|
||||||
let buffer = new Uint32Array(pageImage.data.buffer);
|
let buffer = new Uint32Array(pageImage.data.buffer);
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user