Skip to content
Merged
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
21 changes: 20 additions & 1 deletion resources/js/Pages/testing.jsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { A, Code, CodeBlock, H1, H2, P } from '@/Components'
import { A, Code, CodeBlock, H1, H2, H3, P } from '@/Components'
import dedent from 'dedent-js'

export const meta = {
Expand Down Expand Up @@ -230,6 +230,25 @@ export default function () {
);
`}
/>
<H3>Testing Partial Reloads</H3>
<P>
You may use the <Code>reloadOnly</Code> and <Code>reloadExcept</Code> methods to test how your application responds to <A href="/partial-reloads">partial reloads</A>.{' '}
These methods perform a follow-up request and allow you to make assertions against the response.
</P>
<CodeBlock
language="php"
children={dedent`
$response->assertInertia(fn (Assert $page) => $page
->has('orders')
->missing('statuses')
->reloadOnly('statuses', fn (Assert $reload) => $reload
->missing('orders')
->has('statuses', 5)
)
);
`}
/>
<P>Instead of passing a single prop as a string, you may also pass an array of props to <Code>reloadOnly</Code> or <Code>reloadExcept</Code>.</P>
</>
)
}