Skip to content

Commit

Permalink
chore: bump playwright to v1.45.2
Browse files Browse the repository at this point in the history
  • Loading branch information
sand4rt committed Jul 17, 2024
1 parent e71ec82 commit 0dca662
Show file tree
Hide file tree
Showing 7 changed files with 39 additions and 52 deletions.
2 changes: 1 addition & 1 deletion ct-web-lit/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
},
"devDependencies": {
"@sand4rt/experimental-ct-web": "workspace:*",
"@playwright/test": "^1.45.1",
"@playwright/test": "^1.45.2",
"typescript": "^5.1.3",
"vite": "^4.4.7"
}
Expand Down
2 changes: 1 addition & 1 deletion ct-web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
},
"devDependencies": {
"@sand4rt/experimental-ct-web": "workspace:*",
"@playwright/test": "^1.45.1",
"@playwright/test": "^1.45.2",
"typescript": "^5.1.3",
"vite": "^4.4.7"
}
Expand Down
10 changes: 4 additions & 6 deletions playwright-ct-web/hooks.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,9 @@
* limitations under the License.
*/

import type { JsonObject } from '@playwright/experimental-ct-core/types/component';

export declare function beforeMount<HooksConfig extends JsonObject>(
callback: (params: { hooksConfig?: HooksConfig; }) => Promise<void>
export declare function beforeMount<HooksConfig>(
callback: (params: { hooksConfig?: HooksConfig }) => Promise<void>,
): void;
export declare function afterMount<HooksConfig extends JsonObject>(
callback: (params: { hooksConfig?: HooksConfig; }) => Promise<void>
export declare function afterMount<HooksConfig>(
callback: (params: { hooksConfig?: HooksConfig }) => Promise<void>,
): void;
19 changes: 4 additions & 15 deletions playwright-ct-web/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,25 +15,15 @@
*/

import type { Locator } from '@playwright/test';
import type { JsonObject, JsonValue, } from '@playwright/experimental-ct-core/types/component';
import type { TestType } from '@playwright/experimental-ct-core';

type PickByValue<T, ValueType> = Pick<T, { [Key in keyof T]-?: T[Key] extends ValueType ? Key : never }[keyof T]>;

type IfEquals<X, Y, A, B> = (<T>() => T extends X ? 1 : 2) extends (<T>() => T extends Y ? 1 : 2) ? A : B;
type WritableKeysOf<T> = {[P in keyof T]: IfEquals<{ [Q in P]: T[P] }, { -readonly [Q in P]: T[P] }, P, never>}[keyof T];
type WritablePart<T> = Pick<T, WritableKeysOf<T>>;

type HTMLAttributes<Component extends HTMLElement> = Partial<WritablePart<PickByValue<Component, JsonValue>>>;
type CustomProperties<Component extends HTMLElement> = Partial<PickByValue<Component, JsonValue>>;
type ComponentProps<Component extends HTMLElement> = HTMLAttributes<Component> & CustomProperties<Component>;

type ComponentProps<Component extends HTMLElement> = Partial<Component>;
type ComponentSlot = number | string | ComponentSlot[];
type ComponentSlots = Record<string, ComponentSlot> & { default?: ComponentSlot };

type ComponentEvents = Record<string, Function>;

export interface MountOptions<HooksConfig extends JsonObject, Component extends HTMLElement> {
export interface MountOptions<HooksConfig, Component extends HTMLElement> {
props?: ComponentProps<Component>;
slots?: ComponentSlots;
on?: ComponentEvents;
Expand All @@ -50,11 +40,10 @@ export interface MountResult<Component extends HTMLElement> extends Locator {
}

export const test: TestType<{
mount<HooksConfig extends JsonObject, Component extends HTMLElement = HTMLElement>(
mount<HooksConfig, Component extends HTMLElement = HTMLElement>(
component: new (...args: any[]) => Component,
options?: MountOptions<HooksConfig, Component>
): Promise<MountResult<Component>>;
}>;

export { defineConfig, PlaywrightTestConfig } from '@playwright/experimental-ct-core';
export { expect, devices } from '@playwright/test';
export { defineConfig, PlaywrightTestConfig, expect, devices } from '@playwright/experimental-ct-core';
8 changes: 4 additions & 4 deletions playwright-ct-web/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@sand4rt/experimental-ct-web",
"version": "1.45.1",
"version": "1.45.2",
"description": "Playwright Component Testing for Web Components",
"homepage": "https://playwright.dev",
"repository": {
Expand Down Expand Up @@ -44,13 +44,13 @@
"./package.json": "./package.json"
},
"dependencies": {
"@playwright/experimental-ct-core": "1.45.1"
"@playwright/experimental-ct-core": "1.45.2"
},
"devDependencies": {
"@playwright/test": "1.45.1"
"@playwright/test": "1.45.2"
},
"peerDependencies": {
"@playwright/test": ">=1.45.1"
"@playwright/test": ">=1.45.2"
},
"bin": {
"playwright": "cli.js"
Expand Down
2 changes: 1 addition & 1 deletion playwright-ct-web/register.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@
* limitations under the License.
*/

export default function pwRegister(components: Record<string, any>): void
export default function pwRegister(components: Record<string, any>): void;
48 changes: 24 additions & 24 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 0dca662

Please sign in to comment.