Skip to content
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

Applicability docs #544

Merged
merged 7 commits into from
Nov 20, 2024
Merged
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
2 changes: 1 addition & 1 deletion BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ js_library(
testonly = True,
srcs = [
"scripts/vitest.setup.ts",
"vitest.config.ts",
"vitest.config.mts",
],
visibility = ["//visibility:public"],
deps = [
Expand Down
2 changes: 1 addition & 1 deletion docs/site/src/content/docs/content/assets-views.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ They follow the same guidelines for normal validation references, with the addit

## Applicability

Any object in the tree (including _assets_) may contain an `applicability` property. This is an _expression_ that may conditionally show or hide an asset (and all of it's children) from the view tree. Applicability is dynamically calculated and will automatically update as data changes on the page.
Assets (but not Views) may contain an `applicability` property. This is an _expression_ that may conditionally show or hide an asset (and all of it's children) from the view tree. Applicability is dynamically calculated and will automatically update as data changes on the page.

## Switches

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,8 +149,10 @@ describe("Integration tests", () => {
fireEvent.click(itemNode);
});

itemNode = await screen.findByTestId(item.id);
expect(itemNode.checked).toEqual(true);
await waitFor(async () => {
itemNode = await screen.findByTestId(item.id);
expect(itemNode.checked).toEqual(true);
});
}
});
});
Expand Down
69 changes: 0 additions & 69 deletions react/player/src/__tests__/__snapshots__/app.test.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -68,72 +68,3 @@ exports[`ReactPlayer React > renders into a react comp 1`] = `
"unmount": [Function],
}
`;

exports[`ReactPlayer React renders into a react comp 1`] = `
Object {
"asFragment": [Function],
"baseElement": <body>
<div>
<div
id="first_view"
/>
</div>
</body>,
"container": <div>
<div
id="first_view"
/>
</div>,
"debug": [Function],
"findAllByAltText": [Function],
"findAllByDisplayValue": [Function],
"findAllByLabelText": [Function],
"findAllByPlaceholderText": [Function],
"findAllByRole": [Function],
"findAllByTestId": [Function],
"findAllByText": [Function],
"findAllByTitle": [Function],
"findByAltText": [Function],
"findByDisplayValue": [Function],
"findByLabelText": [Function],
"findByPlaceholderText": [Function],
"findByRole": [Function],
"findByTestId": [Function],
"findByText": [Function],
"findByTitle": [Function],
"getAllByAltText": [Function],
"getAllByDisplayValue": [Function],
"getAllByLabelText": [Function],
"getAllByPlaceholderText": [Function],
"getAllByRole": [Function],
"getAllByTestId": [Function],
"getAllByText": [Function],
"getAllByTitle": [Function],
"getByAltText": [Function],
"getByDisplayValue": [Function],
"getByLabelText": [Function],
"getByPlaceholderText": [Function],
"getByRole": [Function],
"getByTestId": [Function],
"getByText": [Function],
"getByTitle": [Function],
"queryAllByAltText": [Function],
"queryAllByDisplayValue": [Function],
"queryAllByLabelText": [Function],
"queryAllByPlaceholderText": [Function],
"queryAllByRole": [Function],
"queryAllByTestId": [Function],
"queryAllByText": [Function],
"queryAllByTitle": [Function],
"queryByAltText": [Function],
"queryByDisplayValue": [Function],
"queryByLabelText": [Function],
"queryByPlaceholderText": [Function],
"queryByRole": [Function],
"queryByTestId": [Function],
"queryByText": [Function],
"queryByTitle": [Function],
"rerender": [Function],
"unmount": [Function],
}
`;
2 changes: 1 addition & 1 deletion tools/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ load("@aspect_rules_js//js:defs.bzl", "js_library")

exports_files([
"tsup.config.ts.tmpl",
"vitest.config.ts.tmpl",
"vitest.config.mts.tmpl",
])

js_library(
Expand Down
4 changes: 2 additions & 2 deletions tools/defs.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ def vitest_config(name):

expand_template(
name = name,
out = "vitest.config.ts",
out = "vitest.config.mts",
substitutions = {
"%PREFIX%": prefix,
},
template = "//tools:vitest.config.ts.tmpl",
template = "//tools:vitest.config.mts.tmpl",
)
File renamed without changes.
9 changes: 8 additions & 1 deletion vitest.config.ts → vitest.config.mts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,14 @@
export default defineConfig({
test: {
environment: "happy-dom",
exclude: [...configDefaults.exclude, "helpers"],
exclude: [
...configDefaults.exclude,
"helpers",
"bazel-bin",
"bazel-out",
"bazel-player",
"bazel-testlogs",
],

Check warning on line 15 in vitest.config.mts

View check run for this annotation

Codecov / codecov/patch

vitest.config.mts#L8-L15

Added lines #L8 - L15 were not covered by tests
reporters: [
"default",
process.env.XML_OUTPUT_FILE ? "junit" : "basic",
Expand Down