@hotwired/turbo 7.1.0 → 7.2.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/turbo.es2017-esm.js +712 -364
- package/dist/turbo.es2017-umd.js +717 -365
- package/dist/types/core/bardo.d.ts +7 -2
- package/dist/types/core/cache.d.ts +10 -0
- package/dist/types/core/drive/error_renderer.d.ts +1 -0
- package/dist/types/core/drive/form_submission.d.ts +12 -3
- package/dist/types/core/drive/history.d.ts +1 -1
- package/dist/types/core/drive/navigator.d.ts +1 -0
- package/dist/types/core/drive/page_renderer.d.ts +3 -0
- package/dist/types/core/drive/page_view.d.ts +8 -5
- package/dist/types/core/drive/preloader.d.ts +14 -0
- package/dist/types/core/drive/progress_bar.d.ts +1 -0
- package/dist/types/core/drive/visit.d.ts +3 -3
- package/dist/types/core/frames/frame_controller.d.ts +26 -16
- package/dist/types/core/frames/frame_redirector.d.ts +1 -1
- package/dist/types/core/frames/frame_renderer.d.ts +8 -1
- package/dist/types/core/frames/frame_view.d.ts +2 -1
- package/dist/types/core/frames/link_interceptor.d.ts +1 -1
- package/dist/types/core/index.d.ts +11 -2
- package/dist/types/core/native/adapter.d.ts +2 -1
- package/dist/types/core/native/browser_adapter.d.ts +17 -8
- package/dist/types/core/renderer.d.ts +12 -4
- package/dist/types/core/session.d.ts +68 -16
- package/dist/types/core/snapshot.d.ts +2 -1
- package/dist/types/core/view.d.ts +12 -6
- package/dist/types/elements/frame_element.d.ts +5 -1
- package/dist/types/elements/stream_element.d.ts +1 -0
- package/dist/types/elements/stream_source_element.d.ts +7 -0
- package/dist/types/http/fetch_request.d.ts +8 -0
- package/dist/types/observers/cache_observer.d.ts +1 -1
- package/dist/types/observers/form_link_interceptor.d.ts +14 -0
- package/dist/types/observers/link_click_observer.d.ts +2 -2
- package/dist/types/polyfills/submit-event.d.ts +1 -7
- package/dist/types/tests/functional/async_script_tests.d.ts +1 -6
- package/dist/types/tests/functional/autofocus_tests.d.ts +1 -9
- package/dist/types/tests/functional/cache_observer_tests.d.ts +1 -5
- package/dist/types/tests/functional/drive_disabled_tests.d.ts +1 -9
- package/dist/types/tests/functional/drive_tests.d.ts +1 -8
- package/dist/types/tests/functional/form_submission_tests.d.ts +1 -84
- package/dist/types/tests/functional/frame_navigation_tests.d.ts +1 -7
- package/dist/types/tests/functional/frame_tests.d.ts +1 -52
- package/dist/types/tests/functional/import_tests.d.ts +1 -4
- package/dist/types/tests/functional/loading_tests.d.ts +1 -13
- package/dist/types/tests/functional/navigation_tests.d.ts +1 -38
- package/dist/types/tests/functional/pausable_rendering_tests.d.ts +1 -6
- package/dist/types/tests/functional/pausable_requests_tests.d.ts +1 -6
- package/dist/types/tests/functional/preloader_tests.d.ts +1 -0
- package/dist/types/tests/functional/rendering_tests.d.ts +1 -35
- package/dist/types/tests/functional/scroll_restoration_tests.d.ts +1 -6
- package/dist/types/tests/functional/stream_tests.d.ts +1 -6
- package/dist/types/tests/functional/visit_tests.d.ts +1 -15
- package/dist/types/tests/helpers/page.d.ts +44 -0
- package/dist/types/tests/unit/deprecated_adapter_support_test.d.ts +10 -10
- package/dist/types/util.d.ts +6 -3
- package/package.json +22 -8
- package/CHANGELOG.md +0 -3
- package/dist/types/tests/functional/index.d.ts +0 -17
- package/dist/types/tests/helpers/functional_test_case.d.ts +0 -44
- package/dist/types/tests/helpers/remote_channel.d.ts +0 -10
- package/dist/types/tests/helpers/turbo_drive_test_case.d.ts +0 -21
|
@@ -1,12 +1,18 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ReloadReason } from "./native/browser_adapter";
|
|
2
|
+
import { Renderer, Render } from "./renderer";
|
|
2
3
|
import { Snapshot } from "./snapshot";
|
|
3
4
|
import { Position } from "./types";
|
|
4
|
-
export interface
|
|
5
|
-
|
|
5
|
+
export interface ViewRenderOptions<E> {
|
|
6
|
+
resume: (value: any) => void;
|
|
7
|
+
render: Render<E>;
|
|
8
|
+
}
|
|
9
|
+
export interface ViewDelegate<E extends Element, S extends Snapshot<E>> {
|
|
10
|
+
allowsImmediateRender(snapshot: S, options: ViewRenderOptions<E>): boolean;
|
|
11
|
+
preloadOnLoadLinksForView(element: Element): void;
|
|
6
12
|
viewRenderedSnapshot(snapshot: S, isPreview: boolean): void;
|
|
7
|
-
viewInvalidated(): void;
|
|
13
|
+
viewInvalidated(reason: ReloadReason): void;
|
|
8
14
|
}
|
|
9
|
-
export declare abstract class View<E extends Element, S extends Snapshot<E> = Snapshot<E>, R extends Renderer<E, S> = Renderer<E, S>, D extends ViewDelegate<S> = ViewDelegate<S>> {
|
|
15
|
+
export declare abstract class View<E extends Element, S extends Snapshot<E> = Snapshot<E>, R extends Renderer<E, S> = Renderer<E, S>, D extends ViewDelegate<E, S> = ViewDelegate<E, S>> {
|
|
10
16
|
readonly delegate: D;
|
|
11
17
|
readonly element: E;
|
|
12
18
|
renderer?: R;
|
|
@@ -25,7 +31,7 @@ export declare abstract class View<E extends Element, S extends Snapshot<E> = Sn
|
|
|
25
31
|
scrollTo(x: number, y: number): void;
|
|
26
32
|
};
|
|
27
33
|
render(renderer: R): Promise<void>;
|
|
28
|
-
invalidate(): void;
|
|
34
|
+
invalidate(reason: ReloadReason): void;
|
|
29
35
|
prepareToRenderSnapshot(renderer: R): void;
|
|
30
36
|
markAsPreview(isPreview: boolean): void;
|
|
31
37
|
renderSnapshot(renderer: R): Promise<void>;
|
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
import { FetchResponse } from "../http/fetch_response";
|
|
2
|
+
import { Snapshot } from "../core/snapshot";
|
|
2
3
|
export declare enum FrameLoadingStyle {
|
|
3
4
|
eager = "eager",
|
|
4
5
|
lazy = "lazy"
|
|
5
6
|
}
|
|
7
|
+
export declare type FrameElementObservedAttribute = keyof FrameElement & ("disabled" | "complete" | "loading" | "src");
|
|
6
8
|
export interface FrameElementDelegate {
|
|
7
9
|
connect(): void;
|
|
8
10
|
disconnect(): void;
|
|
11
|
+
completeChanged(): void;
|
|
9
12
|
loadingStyleChanged(): void;
|
|
10
13
|
sourceURLChanged(): void;
|
|
11
14
|
disabledChanged(): void;
|
|
@@ -13,13 +16,14 @@ export interface FrameElementDelegate {
|
|
|
13
16
|
linkClickIntercepted(element: Element, url: string): void;
|
|
14
17
|
loadResponse(response: FetchResponse): void;
|
|
15
18
|
fetchResponseLoaded: (fetchResponse: FetchResponse) => void;
|
|
19
|
+
visitCachedSnapshot: (snapshot: Snapshot) => void;
|
|
16
20
|
isLoading: boolean;
|
|
17
21
|
}
|
|
18
22
|
export declare class FrameElement extends HTMLElement {
|
|
19
23
|
static delegateConstructor: new (element: FrameElement) => FrameElementDelegate;
|
|
20
24
|
loaded: Promise<FetchResponse | void>;
|
|
21
25
|
readonly delegate: FrameElementDelegate;
|
|
22
|
-
static get observedAttributes():
|
|
26
|
+
static get observedAttributes(): FrameElementObservedAttribute[];
|
|
23
27
|
constructor();
|
|
24
28
|
connectedCallback(): void;
|
|
25
29
|
disconnectedCallback(): void;
|
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
import { FetchResponse } from "./fetch_response";
|
|
2
2
|
import { FrameElement } from "../elements/frame_element";
|
|
3
|
+
export declare type TurboBeforeFetchRequestEvent = CustomEvent<{
|
|
4
|
+
fetchOptions: RequestInit;
|
|
5
|
+
url: URL;
|
|
6
|
+
resume: (value: any) => void;
|
|
7
|
+
}>;
|
|
8
|
+
export declare type TurboBeforeFetchResponseEvent = CustomEvent<{
|
|
9
|
+
fetchResponse: FetchResponse;
|
|
10
|
+
}>;
|
|
3
11
|
export interface FetchRequestDelegate {
|
|
4
12
|
referrer?: URL;
|
|
5
13
|
prepareHeadersForRequest?(headers: FetchRequestHeaders, request: FetchRequest): void;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { LinkInterceptor, LinkInterceptorDelegate } from "../core/frames/link_interceptor";
|
|
2
|
+
export declare type FormLinkInterceptorDelegate = {
|
|
3
|
+
shouldInterceptFormLinkClick(link: Element): boolean;
|
|
4
|
+
formLinkClickIntercepted(link: Element, form: HTMLFormElement): void;
|
|
5
|
+
};
|
|
6
|
+
export declare class FormLinkInterceptor implements LinkInterceptorDelegate {
|
|
7
|
+
readonly linkInterceptor: LinkInterceptor;
|
|
8
|
+
readonly delegate: FormLinkInterceptorDelegate;
|
|
9
|
+
constructor(delegate: FormLinkInterceptorDelegate, element: HTMLElement);
|
|
10
|
+
start(): void;
|
|
11
|
+
stop(): void;
|
|
12
|
+
shouldInterceptLinkClick(link: Element): boolean;
|
|
13
|
+
linkClickIntercepted(link: Element, action: string): void;
|
|
14
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export interface LinkClickObserverDelegate {
|
|
2
|
-
willFollowLinkToLocation(link: Element, location: URL): boolean;
|
|
2
|
+
willFollowLinkToLocation(link: Element, location: URL, event: MouseEvent): boolean;
|
|
3
3
|
followedLinkToLocation(link: Element, location: URL): void;
|
|
4
4
|
}
|
|
5
5
|
export declare class LinkClickObserver {
|
|
@@ -11,6 +11,6 @@ export declare class LinkClickObserver {
|
|
|
11
11
|
clickCaptured: () => void;
|
|
12
12
|
clickBubbled: (event: MouseEvent) => void;
|
|
13
13
|
clickEventIsSignificant(event: MouseEvent): boolean;
|
|
14
|
-
findLinkFromClickTarget(target: EventTarget | null):
|
|
14
|
+
findLinkFromClickTarget(target: EventTarget | null): HTMLAnchorElement | null | undefined;
|
|
15
15
|
getLocationForLink(link: Element): URL;
|
|
16
16
|
}
|
|
@@ -1,7 +1 @@
|
|
|
1
|
-
|
|
2
|
-
form?: HTMLFormElement;
|
|
3
|
-
type?: string;
|
|
4
|
-
};
|
|
5
|
-
declare const submittersByForm: WeakMap<HTMLFormElement, HTMLElement>;
|
|
6
|
-
declare function findSubmitterFromClickTarget(target: EventTarget | null): FormSubmitter | null;
|
|
7
|
-
declare function clickCaptured(event: Event): void;
|
|
1
|
+
export {};
|
|
@@ -1,6 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export declare class AsyncScriptTests extends TurboDriveTestCase {
|
|
3
|
-
setup(): Promise<void>;
|
|
4
|
-
"test does not emit turbo:load when loaded asynchronously after DOMContentLoaded"(): Promise<void>;
|
|
5
|
-
"test following a link when loaded asynchronously after DOMContentLoaded"(): Promise<void>;
|
|
6
|
-
}
|
|
1
|
+
export {};
|
|
@@ -1,9 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export declare class AutofocusTests extends TurboDriveTestCase {
|
|
3
|
-
setup(): Promise<void>;
|
|
4
|
-
"test autofocus first autofocus element on load"(): Promise<void>;
|
|
5
|
-
"test autofocus first [autofocus] element on visit"(): Promise<void>;
|
|
6
|
-
"test navigating a frame with a descendant link autofocuses [autofocus]:first-of-type"(): Promise<void>;
|
|
7
|
-
"test navigating a frame with a link targeting the frame autofocuses [autofocus]:first-of-type"(): Promise<void>;
|
|
8
|
-
"test navigating a frame with a turbo-frame targeting the frame autofocuses [autofocus]:first-of-type"(): Promise<void>;
|
|
9
|
-
}
|
|
1
|
+
export {};
|
|
@@ -1,9 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export declare class DriveDisabledTests extends TurboDriveTestCase {
|
|
3
|
-
path: string;
|
|
4
|
-
setup(): Promise<void>;
|
|
5
|
-
"test drive disabled by default; click normal link"(): Promise<void>;
|
|
6
|
-
"test drive disabled by default; click link inside data-turbo='true'"(): Promise<void>;
|
|
7
|
-
"test drive disabled by default; submit form inside data-turbo='true'"(): Promise<void>;
|
|
8
|
-
get formSubmitted(): Promise<boolean>;
|
|
9
|
-
}
|
|
1
|
+
export {};
|
|
@@ -1,8 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export declare class DriveTests extends TurboDriveTestCase {
|
|
3
|
-
path: string;
|
|
4
|
-
setup(): Promise<void>;
|
|
5
|
-
"test drive enabled by default; click normal link"(): Promise<void>;
|
|
6
|
-
"test drive to external link"(): Promise<void>;
|
|
7
|
-
"test drive enabled by default; click link inside data-turbo='false'"(): Promise<void>;
|
|
8
|
-
}
|
|
1
|
+
export {};
|
|
@@ -1,84 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export declare class FormSubmissionTests extends TurboDriveTestCase {
|
|
3
|
-
setup(): Promise<void>;
|
|
4
|
-
"test standard form submission renders a progress bar"(): Promise<void>;
|
|
5
|
-
"test form submission with confirmation confirmed"(): Promise<void>;
|
|
6
|
-
"test form submission with confirmation cancelled"(): Promise<void>;
|
|
7
|
-
"test from submission with confirmation overriden"(): Promise<void>;
|
|
8
|
-
"test standard form submission does not render a progress bar before expiring the delay"(): Promise<void>;
|
|
9
|
-
"test standard form submission with redirect response"(): Promise<void>;
|
|
10
|
-
"test standard POST form submission events"(): Promise<void>;
|
|
11
|
-
"test standard POST form submission merges values from both searchParams and body"(): Promise<void>;
|
|
12
|
-
"test standard POST form submission toggles submitter [disabled] attribute"(): Promise<void>;
|
|
13
|
-
"test standard GET form submission"(): Promise<void>;
|
|
14
|
-
"test standard GET form submission events"(): Promise<void>;
|
|
15
|
-
"test standard GET form submission does not incorporate the current page's URLSearchParams values into the submission"(): Promise<void>;
|
|
16
|
-
"test standard GET form submission does not merge values into the [action] attribute"(): Promise<void>;
|
|
17
|
-
"test standard GET form submission omits the [action] value's URLSearchParams from the submission"(): Promise<void>;
|
|
18
|
-
"test standard GET form submission toggles submitter [disabled] attribute"(): Promise<void>;
|
|
19
|
-
"test standard GET form submission appending keys"(): Promise<void>;
|
|
20
|
-
"test standard form submission with empty created response"(): Promise<void>;
|
|
21
|
-
"test standard form submission with empty no-content response"(): Promise<void>;
|
|
22
|
-
"test standard POST form submission with multipart/form-data enctype"(): Promise<void>;
|
|
23
|
-
"test standard GET form submission ignores enctype"(): Promise<void>;
|
|
24
|
-
"test standard POST form submission without an enctype"(): Promise<void>;
|
|
25
|
-
"test no-action form submission with single parameter"(): Promise<void>;
|
|
26
|
-
"test no-action form submission with multiple parameters"(): Promise<void>;
|
|
27
|
-
"test no-action form submission submitter parameters"(): Promise<void>;
|
|
28
|
-
"test input named action with no action attribute"(): Promise<void>;
|
|
29
|
-
"test input named action with action attribute"(): Promise<void>;
|
|
30
|
-
"test invalid form submission with unprocessable entity status"(): Promise<void>;
|
|
31
|
-
"test invalid form submission with long form"(): Promise<void>;
|
|
32
|
-
"test invalid form submission with server error status"(): Promise<void>;
|
|
33
|
-
"test submitter form submission reads button attributes"(): Promise<void>;
|
|
34
|
-
"test submitter POST form submission with multipart/form-data formenctype"(): Promise<void>;
|
|
35
|
-
"test submitter GET submission from submitter with data-turbo-frame"(): Promise<void>;
|
|
36
|
-
"test submitter POST submission from submitter with data-turbo-frame"(): Promise<void>;
|
|
37
|
-
"test frame form GET submission from submitter with data-turbo-frame=_top"(): Promise<void>;
|
|
38
|
-
"test frame form POST submission from submitter with data-turbo-frame=_top"(): Promise<void>;
|
|
39
|
-
"test frame POST form targetting frame submission"(): Promise<void>;
|
|
40
|
-
"test frame POST form targetting frame toggles submitter's [disabled] attribute"(): Promise<void>;
|
|
41
|
-
"test frame GET form targetting frame submission"(): Promise<void>;
|
|
42
|
-
"test frame GET form targetting frame toggles submitter's [disabled] attribute"(): Promise<void>;
|
|
43
|
-
"test frame form GET submission from submitter referencing another frame"(): Promise<void>;
|
|
44
|
-
"test frame form POST submission from submitter referencing another frame"(): Promise<void>;
|
|
45
|
-
"test frame form submission with redirect response"(): Promise<void>;
|
|
46
|
-
"test frame form submission toggles the ancestor frame's [aria-busy] attribute"(): Promise<void>;
|
|
47
|
-
"test frame form submission toggles the target frame's [aria-busy] attribute"(): Promise<void>;
|
|
48
|
-
"test frame form submission with empty created response"(): Promise<void>;
|
|
49
|
-
"test frame form submission with empty no-content response"(): Promise<void>;
|
|
50
|
-
"test frame form submission within a frame submits the Turbo-Frame header"(): Promise<void>;
|
|
51
|
-
"test invalid frame form submission with unprocessable entity status"(): Promise<void>;
|
|
52
|
-
"test invalid frame form submission with internal server errror status"(): Promise<void>;
|
|
53
|
-
"test frame form submission with stream response"(): Promise<void>;
|
|
54
|
-
"test frame form submission with HTTP verb other than GET or POST"(): Promise<void>;
|
|
55
|
-
"test frame form submission with [data-turbo=false] on the form"(): Promise<void>;
|
|
56
|
-
"test frame form submission with [data-turbo=false] on the submitter"(): Promise<void>;
|
|
57
|
-
"test frame form submission ignores submissions with their defaultPrevented"(): Promise<void>;
|
|
58
|
-
"test form submission with [data-turbo=false] on the form"(): Promise<void>;
|
|
59
|
-
"test form submission with [data-turbo=false] on the submitter"(): Promise<void>;
|
|
60
|
-
"test form submission skipped within method=dialog"(): Promise<void>;
|
|
61
|
-
"test form submission skipped with submitter formmethod=dialog"(): Promise<void>;
|
|
62
|
-
"test form submission targetting frame skipped within method=dialog"(): Promise<void>;
|
|
63
|
-
"test form submission targetting frame skipped with submitter formmethod=dialog"(): Promise<void>;
|
|
64
|
-
"test form submission targets disabled frame"(): Promise<void>;
|
|
65
|
-
"test form submission targeting a frame submits the Turbo-Frame header"(): Promise<void>;
|
|
66
|
-
"test link method form submission inside frame"(): Promise<void>;
|
|
67
|
-
"test link method form submission inside frame with data-turbo-frame=_top"(): Promise<void>;
|
|
68
|
-
"test link method form submission inside frame with data-turbo-frame target"(): Promise<void>;
|
|
69
|
-
"test stream link method form submission inside frame"(): Promise<void>;
|
|
70
|
-
"test link method form submission within form inside frame"(): Promise<void>;
|
|
71
|
-
"test link method form submission inside frame with confirmation confirmed"(): Promise<void>;
|
|
72
|
-
"test link method form submission inside frame with confirmation cancelled"(): Promise<void>;
|
|
73
|
-
"test link method form submission outside frame"(): Promise<void>;
|
|
74
|
-
"test stream link method form submission outside frame"(): Promise<void>;
|
|
75
|
-
"test link method form submission within form outside frame"(): Promise<void>;
|
|
76
|
-
"test stream link method form submission within form outside frame"(): Promise<void>;
|
|
77
|
-
"test turbo:before-fetch-request fires on the form element"(): Promise<void>;
|
|
78
|
-
"test turbo:before-fetch-response fires on the form element"(): Promise<void>;
|
|
79
|
-
"test POST to external action ignored"(): Promise<void>;
|
|
80
|
-
"test POST to external action within frame ignored"(): Promise<void>;
|
|
81
|
-
"test POST to external action targetting frame ignored"(): Promise<void>;
|
|
82
|
-
get formSubmitStarted(): Promise<boolean>;
|
|
83
|
-
get formSubmitEnded(): Promise<boolean>;
|
|
84
|
-
}
|
|
1
|
+
export {};
|
|
@@ -1,7 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export declare class FrameNavigationTests extends TurboDriveTestCase {
|
|
3
|
-
setup(): Promise<void>;
|
|
4
|
-
"test frame navigation with descendant link"(): Promise<void>;
|
|
5
|
-
"test frame navigation with self link"(): Promise<void>;
|
|
6
|
-
"test frame navigation with exterior link"(): Promise<void>;
|
|
7
|
-
}
|
|
1
|
+
export {};
|
|
@@ -1,57 +1,6 @@
|
|
|
1
|
-
import { TurboDriveTestCase } from "../helpers/turbo_drive_test_case";
|
|
2
|
-
export declare class FrameTests extends TurboDriveTestCase {
|
|
3
|
-
setup(): Promise<void>;
|
|
4
|
-
"test navigating a frame a second time does not leak event listeners"(): Promise<void>;
|
|
5
|
-
"test following a link preserves the current <turbo-frame> element's attributes"(): Promise<void>;
|
|
6
|
-
"test following a link sets the frame element's [src]"(): Promise<void>;
|
|
7
|
-
"test a frame whose src references itself does not infinitely loop"(): Promise<void>;
|
|
8
|
-
"test following a link driving a frame toggles the [aria-busy=true] attribute"(): Promise<void>;
|
|
9
|
-
"test following a link to a page without a matching frame results in an empty frame"(): Promise<void>;
|
|
10
|
-
"test following a link within a frame with a target set navigates the target frame"(): Promise<void>;
|
|
11
|
-
"test following a link in rapid succession cancels the previous request"(): Promise<void>;
|
|
12
|
-
"test following a link within a descendant frame whose ancestor declares a target set navigates the descendant frame"(): Promise<void>;
|
|
13
|
-
"test following a link that declares data-turbo-frame within a frame whose ancestor respects the override"(): Promise<void>;
|
|
14
|
-
"test following a form within a nested frame with form target top"(): Promise<void>;
|
|
15
|
-
"test following a form within a nested frame with child frame target top"(): Promise<void>;
|
|
16
|
-
"test following a link within a frame with target=_top navigates the page"(): Promise<void>;
|
|
17
|
-
"test following a link that declares data-turbo-frame='_self' within a frame with target=_top navigates the frame itself"(): Promise<void>;
|
|
18
|
-
"test following a link to a page with a <turbo-frame recurse> which lazily loads a matching frame"(): Promise<void>;
|
|
19
|
-
"test submitting a form that redirects to a page with a <turbo-frame recurse> which lazily loads a matching frame"(): Promise<void>;
|
|
20
|
-
"test removing [disabled] attribute from eager-loaded frame navigates it"(): Promise<void>;
|
|
21
|
-
"test evaluates frame script elements on each render"(): Promise<void>;
|
|
22
|
-
"test does not evaluate data-turbo-eval=false scripts"(): Promise<void>;
|
|
23
|
-
"test redirecting in a form is still navigatable after redirect"(): Promise<void>;
|
|
24
|
-
"test 'turbo:frame-render' is triggered after frame has finished rendering"(): Promise<void>;
|
|
25
|
-
"test navigating a frame fires events"(): Promise<void>;
|
|
26
|
-
"test following inner link reloads frame on every click"(): Promise<void>;
|
|
27
|
-
"test following outer link reloads frame on every click"(): Promise<void>;
|
|
28
|
-
"test following outer form reloads frame on every submit"(): Promise<void>;
|
|
29
|
-
"test an inner/outer link reloads frame on every click"(): Promise<void>;
|
|
30
|
-
"test an inner/outer form reloads frame on every submit"(): Promise<void>;
|
|
31
|
-
"test reconnecting after following a link does not reload the frame"(): Promise<void>;
|
|
32
|
-
"test navigating pushing URL state from a frame navigation fires events"(): Promise<void>;
|
|
33
|
-
"test navigating a frame with a form[method=get] that does not redirect still updates the [src]"(): Promise<void>;
|
|
34
|
-
"test navigating turbo-frame[data-turbo-action=advance] from within pushes URL state"(): Promise<void>;
|
|
35
|
-
"test navigating turbo-frame[data-turbo-action=advance] to the same URL clears the [aria-busy] and [data-turbo-preview] state"(): Promise<void>;
|
|
36
|
-
"test navigating a turbo-frame with an a[data-turbo-action=advance] preserves page state"(): Promise<void>;
|
|
37
|
-
"test a turbo-frame that has been driven by a[data-turbo-action] can be navigated normally"(): Promise<void>;
|
|
38
|
-
"test navigating turbo-frame from within with a[data-turbo-action=advance] pushes URL state"(): Promise<void>;
|
|
39
|
-
"test navigating frame with a[data-turbo-action=advance] pushes URL state"(): Promise<void>;
|
|
40
|
-
"test navigating frame with form[method=get][data-turbo-action=advance] pushes URL state"(): Promise<void>;
|
|
41
|
-
"test navigating frame with form[method=get][data-turbo-action=advance] to the same URL clears the [aria-busy] and [data-turbo-preview] state"(): Promise<void>;
|
|
42
|
-
"test navigating frame with form[method=post][data-turbo-action=advance] pushes URL state"(): Promise<void>;
|
|
43
|
-
"test navigating frame with form[method=post][data-turbo-action=advance] to the same URL clears the [aria-busy] and [data-turbo-preview] state"(): Promise<void>;
|
|
44
|
-
"test navigating frame with button[data-turbo-action=advance] pushes URL state"(): Promise<void>;
|
|
45
|
-
"test navigating back after pushing URL state from a turbo-frame[data-turbo-action=advance] restores the frames previous contents"(): Promise<void>;
|
|
46
|
-
"test navigating back then forward after pushing URL state from a turbo-frame[data-turbo-action=advance] restores the frames next contents"(): Promise<void>;
|
|
47
|
-
"test turbo:before-fetch-request fires on the frame element"(): Promise<void>;
|
|
48
|
-
"test turbo:before-fetch-response fires on the frame element"(): Promise<void>;
|
|
49
|
-
withoutChangingEventListenersCount(callback: () => void): Promise<void>;
|
|
50
|
-
fillInSelector(selector: string, value: string): Promise<void>;
|
|
51
|
-
get frameScriptEvaluationCount(): Promise<number | undefined>;
|
|
52
|
-
}
|
|
53
1
|
declare global {
|
|
54
2
|
interface Window {
|
|
55
3
|
frameScriptEvaluationCount?: number;
|
|
56
4
|
}
|
|
57
5
|
}
|
|
6
|
+
export {};
|
|
@@ -1,18 +1,6 @@
|
|
|
1
|
-
import { TurboDriveTestCase } from "../helpers/turbo_drive_test_case";
|
|
2
1
|
declare global {
|
|
3
2
|
interface Window {
|
|
4
3
|
savedElement: Element | null;
|
|
5
4
|
}
|
|
6
5
|
}
|
|
7
|
-
export
|
|
8
|
-
setup(): Promise<void>;
|
|
9
|
-
"test eager loading within a details element"(): Promise<void>;
|
|
10
|
-
"test lazy loading within a details element"(): Promise<void>;
|
|
11
|
-
"test changing loading attribute from lazy to eager loads frame"(): Promise<void>;
|
|
12
|
-
"test navigating a visible frame with loading=lazy navigates"(): Promise<void>;
|
|
13
|
-
"test changing src attribute on a frame with loading=lazy defers navigation"(): Promise<void>;
|
|
14
|
-
"test changing src attribute on a frame with loading=eager navigates"(): Promise<void>;
|
|
15
|
-
"test reloading a frame reloads the content"(): Promise<void>;
|
|
16
|
-
"test navigating away from a page does not reload its frames"(): Promise<void>;
|
|
17
|
-
"test disconnecting and reconnecting a frame does not reload the frame"(): Promise<void>;
|
|
18
|
-
}
|
|
6
|
+
export {};
|
|
@@ -1,38 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export declare class NavigationTests extends TurboDriveTestCase {
|
|
3
|
-
setup(): Promise<void>;
|
|
4
|
-
"test navigating renders a progress bar"(): Promise<void>;
|
|
5
|
-
"test navigating does not render a progress bar before expiring the delay"(): Promise<void>;
|
|
6
|
-
"test after loading the page"(): Promise<void>;
|
|
7
|
-
"test following a same-origin unannotated link"(): Promise<void>;
|
|
8
|
-
"test following a same-origin unannotated custom element link"(): Promise<void>;
|
|
9
|
-
"test following a same-origin unannotated link with search params"(): Promise<void>;
|
|
10
|
-
"test following a same-origin unannotated form[method=GET]"(): Promise<void>;
|
|
11
|
-
"test following a same-origin data-turbo-action=replace link"(): Promise<void>;
|
|
12
|
-
"test following a same-origin GET form[data-turbo-action=replace]"(): Promise<void>;
|
|
13
|
-
"test following a same-origin GET form button[data-turbo-action=replace]"(): Promise<void>;
|
|
14
|
-
"test following a same-origin POST form[data-turbo-action=replace]"(): Promise<void>;
|
|
15
|
-
"test following a same-origin POST form button[data-turbo-action=replace]"(): Promise<void>;
|
|
16
|
-
"test following a same-origin data-turbo=false link"(): Promise<void>;
|
|
17
|
-
"test following a same-origin unannotated link inside a data-turbo=false container"(): Promise<void>;
|
|
18
|
-
"test following a same-origin data-turbo=true link inside a data-turbo=false container"(): Promise<void>;
|
|
19
|
-
"test following a same-origin anchored link"(): Promise<void>;
|
|
20
|
-
"test following a same-origin link to a named anchor"(): Promise<void>;
|
|
21
|
-
"test following a cross-origin unannotated link"(): Promise<void>;
|
|
22
|
-
"test following a same-origin [target] link"(): Promise<void>;
|
|
23
|
-
"test following a same-origin [download] link"(): Promise<void>;
|
|
24
|
-
"test following a same-origin link inside an SVG element"(): Promise<void>;
|
|
25
|
-
"test following a cross-origin link inside an SVG element"(): Promise<void>;
|
|
26
|
-
"test clicking the back button"(): Promise<void>;
|
|
27
|
-
"test clicking the forward button"(): Promise<void>;
|
|
28
|
-
"test link targeting a disabled turbo-frame navigates the page"(): Promise<void>;
|
|
29
|
-
"test skip link with hash-only path scrolls to the anchor without a visit"(): Promise<void>;
|
|
30
|
-
"test skip link with hash-only path moves focus and changes tab order"(): Promise<void>;
|
|
31
|
-
"test same-page anchored replace link assumes the intention was a refresh"(): Promise<void>;
|
|
32
|
-
"test navigating back to anchored URL"(): Promise<void>;
|
|
33
|
-
"test following a redirection"(): Promise<void>;
|
|
34
|
-
"test clicking the back button after redirection"(): Promise<void>;
|
|
35
|
-
"test same-page anchor visits do not trigger visit events"(): Promise<void>;
|
|
36
|
-
"test correct referrer header"(): Promise<void>;
|
|
37
|
-
"test double-clicking on a link"(): Promise<void>;
|
|
38
|
-
}
|
|
1
|
+
export {};
|
|
@@ -1,6 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export declare class PausableRenderingTests extends TurboDriveTestCase {
|
|
3
|
-
setup(): Promise<void>;
|
|
4
|
-
"test pauses and resumes rendering"(): Promise<void>;
|
|
5
|
-
"test aborts rendering"(): Promise<void>;
|
|
6
|
-
}
|
|
1
|
+
export {};
|
|
@@ -1,6 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export declare class PausableRequestsTests extends TurboDriveTestCase {
|
|
3
|
-
setup(): Promise<void>;
|
|
4
|
-
"test pauses and resumes request"(): Promise<void>;
|
|
5
|
-
"test aborts request"(): Promise<void>;
|
|
6
|
-
}
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,41 +1,7 @@
|
|
|
1
|
-
import { TurboDriveTestCase } from "../helpers/turbo_drive_test_case";
|
|
2
|
-
import { Element } from "@theintern/leadfoot";
|
|
3
|
-
export declare class RenderingTests extends TurboDriveTestCase {
|
|
4
|
-
setup(): Promise<void>;
|
|
5
|
-
"test triggers before-render and render events"(): Promise<void>;
|
|
6
|
-
"test triggers before-render and render events for error pages"(): Promise<void>;
|
|
7
|
-
"test reloads when tracked elements change"(): Promise<void>;
|
|
8
|
-
"test wont reload when tracked elements has a nonce"(): Promise<void>;
|
|
9
|
-
"test reloads when turbo-visit-control setting is reload"(): Promise<void>;
|
|
10
|
-
"test accumulates asset elements in head"(): Promise<void>;
|
|
11
|
-
"test replaces provisional elements in head"(): Promise<void>;
|
|
12
|
-
"test evaluates head stylesheet elements"(): Promise<void>;
|
|
13
|
-
"test does not evaluate head stylesheet elements inside noscript elements"(): Promise<void>;
|
|
14
|
-
"skip evaluates head script elements once"(): Promise<void>;
|
|
15
|
-
"test evaluates body script elements on each render"(): Promise<void>;
|
|
16
|
-
"test does not evaluate data-turbo-eval=false scripts"(): Promise<void>;
|
|
17
|
-
"test preserves permanent elements"(): Promise<void>;
|
|
18
|
-
"test preserves permanent elements within turbo-frames"(): Promise<void>;
|
|
19
|
-
"test preserves permanent elements within turbo-frames rendered without layouts"(): Promise<void>;
|
|
20
|
-
"test preserves permanent element video playback"(): Promise<void>;
|
|
21
|
-
"test before-cache event"(): Promise<void>;
|
|
22
|
-
"test mutation record as before-cache notification"(): Promise<void>;
|
|
23
|
-
"test error pages"(): Promise<void>;
|
|
24
|
-
get assetElements(): Promise<Element[]>;
|
|
25
|
-
get provisionalElements(): Promise<Element[]>;
|
|
26
|
-
get headElements(): Promise<Element[]>;
|
|
27
|
-
get permanentElement(): Promise<Element>;
|
|
28
|
-
get headScriptEvaluationCount(): Promise<number | undefined>;
|
|
29
|
-
get bodyScriptEvaluationCount(): Promise<number | undefined>;
|
|
30
|
-
get isStylesheetEvaluated(): Promise<boolean>;
|
|
31
|
-
get isNoscriptStylesheetEvaluated(): Promise<boolean>;
|
|
32
|
-
modifyBodyBeforeCaching(): Promise<any>;
|
|
33
|
-
beforeCache(callback: (body: HTMLElement) => void): Promise<any>;
|
|
34
|
-
modifyBodyAfterRemoval(): Promise<any>;
|
|
35
|
-
}
|
|
36
1
|
declare global {
|
|
37
2
|
interface Window {
|
|
38
3
|
headScriptEvaluationCount?: number;
|
|
39
4
|
bodyScriptEvaluationCount?: number;
|
|
40
5
|
}
|
|
41
6
|
}
|
|
7
|
+
export {};
|
|
@@ -1,6 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export declare class ScrollRestorationTests extends TurboDriveTestCase {
|
|
3
|
-
"test landing on an anchor"(): Promise<void>;
|
|
4
|
-
"test reloading after scrolling"(): Promise<void>;
|
|
5
|
-
"test returning from history"(): Promise<void>;
|
|
6
|
-
}
|
|
1
|
+
export {};
|
|
@@ -1,6 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export declare class StreamTests extends FunctionalTestCase {
|
|
3
|
-
setup(): Promise<void>;
|
|
4
|
-
"test receiving a stream message"(): Promise<void>;
|
|
5
|
-
"test receiving a stream message with css selector target"(): Promise<void>;
|
|
6
|
-
}
|
|
1
|
+
export {};
|
|
@@ -1,15 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export declare class VisitTests extends TurboDriveTestCase {
|
|
3
|
-
setup(): Promise<void>;
|
|
4
|
-
"test programmatically visiting a same-origin location"(): Promise<void>;
|
|
5
|
-
"skip programmatically visiting a cross-origin location falls back to window.location"(): Promise<void>;
|
|
6
|
-
"test visiting a location served with a non-HTML content type"(): Promise<void>;
|
|
7
|
-
"test canceling a before-visit event prevents navigation"(): Promise<void>;
|
|
8
|
-
"test navigation by history is not cancelable"(): Promise<void>;
|
|
9
|
-
"test turbo:before-fetch-request event.detail"(): Promise<void>;
|
|
10
|
-
"test turbo:before-fetch-request event.detail encodes searchParams"(): Promise<void>;
|
|
11
|
-
"test turbo:before-fetch-response open new site"(): Promise<void>;
|
|
12
|
-
"test cache does not override response after redirect"(): Promise<void>;
|
|
13
|
-
visitLocation(location: string): Promise<void>;
|
|
14
|
-
cancelNextVisit(): Promise<void>;
|
|
15
|
-
}
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { JSHandle, Locator, Page } from "@playwright/test";
|
|
2
|
+
declare type EventLog = [string, any, string | null];
|
|
3
|
+
declare type MutationLog = [string, string | null, string | null];
|
|
4
|
+
export declare function attributeForSelector(page: Page, selector: string, attributeName: string): Promise<string | null>;
|
|
5
|
+
export declare function clickWithoutScrolling(page: Page, selector: string, options?: {}): Promise<false | void>;
|
|
6
|
+
export declare function clearLocalStorage(page: Page): Promise<void>;
|
|
7
|
+
export declare function disposeAll(...handles: JSHandle[]): Promise<void[]>;
|
|
8
|
+
export declare function getFromLocalStorage(page: Page, key: string): Promise<string | null>;
|
|
9
|
+
export declare function getSearchParam(url: string, key: string): string | null;
|
|
10
|
+
export declare function hash(url: string): string;
|
|
11
|
+
export declare function hasSelector(page: Page, selector: string): Promise<boolean>;
|
|
12
|
+
export declare function innerHTMLForSelector(page: Page, selector: string): Promise<string>;
|
|
13
|
+
export declare function isScrolledToSelector(page: Page, selector: string): Promise<boolean>;
|
|
14
|
+
export declare function nextBeat(): Promise<void>;
|
|
15
|
+
export declare function nextBody(_page: Page, timeout?: number): Promise<void>;
|
|
16
|
+
export declare function nextEventNamed(page: Page, eventName: string): Promise<any>;
|
|
17
|
+
export declare function nextEventOnTarget(page: Page, elementId: string, eventName: string): Promise<any>;
|
|
18
|
+
export declare function nextAttributeMutationNamed(page: Page, elementId: string, attributeName: string): Promise<string | null>;
|
|
19
|
+
export declare function noNextEventNamed(page: Page, eventName: string): Promise<boolean>;
|
|
20
|
+
export declare function noNextEventOnTarget(page: Page, elementId: string, eventName: string): Promise<boolean>;
|
|
21
|
+
export declare function outerHTMLForSelector(page: Page, selector: string): Promise<string>;
|
|
22
|
+
export declare function pathname(url: string): string;
|
|
23
|
+
export declare function propertyForSelector(page: Page, selector: string, propertyName: string): Promise<any>;
|
|
24
|
+
export declare function readEventLogs(page: Page, length?: number): Promise<EventLog[]>;
|
|
25
|
+
export declare function readMutationLogs(page: Page, length?: number): Promise<MutationLog[]>;
|
|
26
|
+
export declare function search(url: string): string;
|
|
27
|
+
export declare function searchParams(url: string): URLSearchParams;
|
|
28
|
+
export declare function selectorHasFocus(page: Page, selector: string): Promise<boolean>;
|
|
29
|
+
export declare function setLocalStorageFromEvent(page: Page, eventName: string, storageKey: string, storageValue: string): Promise<void>;
|
|
30
|
+
export declare function scrollPosition(page: Page): Promise<{
|
|
31
|
+
x: number;
|
|
32
|
+
y: number;
|
|
33
|
+
}>;
|
|
34
|
+
export declare function isScrolledToTop(page: Page): Promise<boolean>;
|
|
35
|
+
export declare function scrollToSelector(page: Page, selector: string): Promise<void>;
|
|
36
|
+
export declare function sleep(timeout?: number): Promise<void>;
|
|
37
|
+
export declare function strictElementEquals(left: Locator, right: Locator): Promise<boolean>;
|
|
38
|
+
export declare function textContent(page: Page, html: string): Promise<string | null>;
|
|
39
|
+
export declare function visitAction(page: Page): Promise<string>;
|
|
40
|
+
export declare function waitForPathname(page: Page, pathname: string): Promise<void>;
|
|
41
|
+
export declare function waitUntilSelector(page: Page, selector: string, state?: "visible" | "attached"): Promise<import("playwright-core").ElementHandle<HTMLElement | SVGElement>>;
|
|
42
|
+
export declare function waitUntilNoSelector(page: Page, selector: string, state?: "hidden" | "detached"): Promise<import("playwright-core").ElementHandle<HTMLElement | SVGElement> | null>;
|
|
43
|
+
export declare function willChangeBody(page: Page, callback: () => Promise<void>): Promise<boolean>;
|
|
44
|
+
export {};
|
|
@@ -9,16 +9,16 @@ export declare class DeprecatedAdapterSupportTest extends DOMTestCase implements
|
|
|
9
9
|
teardown(): Promise<void>;
|
|
10
10
|
"test visit proposal location includes deprecated absoluteURL property"(): Promise<void>;
|
|
11
11
|
"test visit start location includes deprecated absoluteURL property"(): Promise<void>;
|
|
12
|
-
visitProposedToLocation(location: URL,
|
|
12
|
+
visitProposedToLocation(location: URL, _options?: Partial<VisitOptions>): void;
|
|
13
13
|
visitStarted(visit: Visit): void;
|
|
14
|
-
visitCompleted(
|
|
15
|
-
visitFailed(
|
|
16
|
-
visitRequestStarted(
|
|
17
|
-
visitRequestCompleted(
|
|
18
|
-
visitRequestFailedWithStatusCode(
|
|
19
|
-
visitRequestFinished(
|
|
20
|
-
visitRendered(
|
|
21
|
-
formSubmissionStarted(
|
|
22
|
-
formSubmissionFinished(
|
|
14
|
+
visitCompleted(_visit: Visit): void;
|
|
15
|
+
visitFailed(_visit: Visit): void;
|
|
16
|
+
visitRequestStarted(_visit: Visit): void;
|
|
17
|
+
visitRequestCompleted(_visit: Visit): void;
|
|
18
|
+
visitRequestFailedWithStatusCode(_visit: Visit, _statusCode: number): void;
|
|
19
|
+
visitRequestFinished(_visit: Visit): void;
|
|
20
|
+
visitRendered(_visit: Visit): void;
|
|
21
|
+
formSubmissionStarted(_formSubmission: FormSubmission): void;
|
|
22
|
+
formSubmissionFinished(_formSubmission: FormSubmission): void;
|
|
23
23
|
pageInvalidated(): void;
|
|
24
24
|
}
|
package/dist/types/util.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
export declare type DispatchOptions = {
|
|
1
|
+
export declare type DispatchOptions<T extends CustomEvent> = {
|
|
2
2
|
target: EventTarget;
|
|
3
3
|
cancelable: boolean;
|
|
4
|
-
detail:
|
|
4
|
+
detail: T["detail"];
|
|
5
5
|
};
|
|
6
|
-
export declare function dispatch(eventName: string, { target, cancelable, detail }?: Partial<DispatchOptions
|
|
6
|
+
export declare function dispatch<T extends CustomEvent>(eventName: string, { target, cancelable, detail }?: Partial<DispatchOptions<T>>): CustomEvent<T["detail"]>;
|
|
7
7
|
export declare function nextAnimationFrame(): Promise<void>;
|
|
8
8
|
export declare function nextEventLoopTick(): Promise<void>;
|
|
9
9
|
export declare function nextMicrotask(): Promise<void>;
|
|
@@ -13,3 +13,6 @@ export declare function uuid(): string;
|
|
|
13
13
|
export declare function getAttribute(attributeName: string, ...elements: (Element | undefined)[]): string | null;
|
|
14
14
|
export declare function markAsBusy(...elements: Element[]): void;
|
|
15
15
|
export declare function clearBusyState(...elements: Element[]): void;
|
|
16
|
+
export declare function getMetaElement(name: string): HTMLMetaElement | null;
|
|
17
|
+
export declare function getMetaContent(name: string): string | null;
|
|
18
|
+
export declare function setMetaContent(name: string, content: string): HTMLMetaElement;
|