Skip to content

Add skiko with version #225

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,11 @@ export const API_URLS = {
get VERSIONS() {
return `${this.server}/versions`;
},
SKIKO_MJS() {
return `${this.composeServer}/api/resource/skiko.mjs`;
SKIKO_MJS(version) {
return `${this.composeServer}/api/resource/skiko-${version}.mjs`;
},
SKIKO_WASM() {
return `${this.composeServer}/api/resource/skiko.wasm`;
SKIKO_WASM(version) {
return `${this.composeServer}/api/resource/skiko-${version}.wasm`;
},
get JQUERY() {
return `https://cdn.jsdelivr.net/npm/jquery@1/dist/jquery.min.js`;
Expand Down
17 changes: 0 additions & 17 deletions src/webdemo-api.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ export default class WebDemoApi {
const MINIMAL_VERSION_IR = '1.5.0';
const MINIMAL_VERSION_WASM = '1.9.0';
const MINIMAL_VERSION_SWIFT_EXPORT = '2.0.0';
const MAX_VERSION_COMPOSE_EXPORT = '2.0.0';

if (
platform === TargetPlatforms.JS_IR &&
Expand Down Expand Up @@ -90,22 +89,6 @@ export default class WebDemoApi {
});
}

if (
platform === TargetPlatforms.COMPOSE_WASM &&
compilerVersion >= MAX_VERSION_COMPOSE_EXPORT
) {
return Promise.resolve({
output: '',
errors: [
{
severity: 'ERROR',
message: `${TargetPlatforms.COMPOSE_WASM.printableName} compiler backend accessible only less ${MAX_VERSION_COMPOSE_EXPORT} version`,
},
],
jsCode: '',
});
}

if (
platform === TargetPlatforms.SWIFT_EXPORT &&
compilerVersion < MINIMAL_VERSION_SWIFT_EXPORT
Expand Down
13 changes: 11 additions & 2 deletions tests/utils/screenshots.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,14 @@ export async function hideCursor(node: Locator, callback: () => Promise<void>) {
await cursor.evaluate((element) => (element.style.display = null));
}

const MAX_DIFF_PIXEL_RATIO = 0.01;

export function checkScreenshot(node: Locator, message: string) {
return hideCursor(node, () => expect(node, message).toHaveScreenshot());
return hideCursor(node, () =>
expect(node, message).toHaveScreenshot({
maxDiffPixelRatio: MAX_DIFF_PIXEL_RATIO,
}),
);
}

export function checkEditorView(editor: Locator, message: string) {
Expand All @@ -34,6 +40,9 @@ export function checkEditorView(editor: Locator, message: string) {
height: boundingBox.height + margins.bottom,
};

await expect(editor.page(), message).toHaveScreenshot({ clip });
await expect(editor.page(), message).toHaveScreenshot({
clip,
maxDiffPixelRatio: MAX_DIFF_PIXEL_RATIO,
});
});
}
Loading