Skip to content

Streamline status page tests - #462

Open
jbrooksuk wants to merge 1 commit into
mainfrom
codex/streamline-test-coverage
Open

Streamline status page tests#462
jbrooksuk wants to merge 1 commit into
mainfrom
codex/streamline-test-coverage

Conversation

@jbrooksuk

Copy link
Copy Markdown
Member

Summary

  • consolidate overlapping status-page and render-hook feature coverage
  • replace serialized HTML assertions with visible behavior and semantic accessibility checks
  • retain stable theme selectors as an intentional public contract
  • add focused unit coverage for scoped render hooks and hidden-content metadata

Testing

  • php -d memory_limit=512M vendor/bin/pest --ci --compact
  • composer test:lint
  • vendor/bin/phpstan analyse --no-progress --memory-limit=512M

Full suite: 1,121 passed, 2 todos, 4,115 assertions.

Consolidate overlapping page and render-hook coverage while retaining
the stable theme selector contract. Assert user-visible behavior and
accessibility semantics without coupling tests to serialized markup.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

馃挕 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: ea4e4584ef

鈩癸笍 About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 馃憤.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +14 to +18
$viewData = app(Cachet::class)->render()->getData();

expect($viewData)
->title->toBe('Acme Status')
->description->toBe('A private production system.');

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Verify metadata in the rendered response

Calling render()->getData() bypasses resources/views/components/cachet.blade.php, so this test remains green if the layout stops emitting the <title> or description <meta> tags. The request-level assertions that previously covered those tags were removed, and no other status-page test checks the rendered metadata; retain a feature assertion against the response HTML.

Useful? React with 馃憤聽/ 馃憥.

Comment on lines 14 to 16
$this->get(route('cachet.status-page.incident', $incident))
->assertOk()
->assertSeeText('API connectivity')
->assertSee(__('cachet::incident.affected_components_header'))

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Preserve detail-page heading semantics

When an incident or schedule name remains visible but is changed from an <h1> to a non-heading element, these consolidated text assertions still pass. The previous incident and schedule tests explicitly protected the pages' primary-heading semantics, and no replacement assertion checks them; keep a DOM-level <h1> assertion for both detail pages.

Useful? React with 馃憤聽/ 馃憥.

Comment on lines 426 to 429
$this->get(route('cachet.status-page'))
->assertOk()
->assertSee('<strong>primary</strong>', escape: false)
->assertSeeText('primary')
->assertDontSee('<script>alert(1)</script>', escape: false);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Verify Markdown reaches the rendered response

If the component or incident view accidentally renders the escaped raw field instead of its formatted Markdown accessor, assertSeeText('primary') still passes because **primary** contains that text, while the script assertion also passes because escaping removes the literal tag. The helper unit tests only verify Markdown conversion in isolation, not the model-to-view wiring that the removed <strong> assertions covered; retain an HTML assertion for the rendered emphasis.

Useful? React with 馃憤聽/ 馃憥.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant