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

web: Provide tests for the aggregate cards, fix a few minor things #9744

Draft
wants to merge 7 commits into
base: web/cleanup/admin-overview
Choose a base branch
from

Conversation

kensternberg-authentik
Copy link
Contributor

@kensternberg-authentik kensternberg-authentik commented May 15, 2024

web: Provide tests for the aggregate cards, fix a few minor things

Details

This commit provides tests alongside the stories for the aggregate cards. The tests are fairly basic, but they’re good enough for starting and they provide a pretty good example of how to test when a promise with a delay is involved.

Two minor fixes in this code:

  • The subtext was given a small amount of whitespace above, to remove the crowding that happened. It looks much better with a half-rem of space.

  • In the rare case that we have a card header with no icon, the ‘ ’ symbol that separates the icon from the header is now not rendered. In the previous form, it would push the header to the left, making it “hang in space” one rem to the right of the visual line formed by the rightmost content border. The padding between the header, body, and footer is odd; body is 1 rem, the header and footer 2rems. This looks good for the graphs, but for the text, not so much.

  • The code has been formatted (make web)

  • The documentation has been updated

As is typical of a system where a new build engine is involved, this thing is sadly fragile. Use the
wrong import style in wdio.conf.js and it breaks; there are several notes in tsconfig.test.conf and
wdio.conf.ts to tell eslint or tsc not to complain, it's just a different build with different
criteria, the native criteria don't apply.

On the other hand, writing tests is easy and predictable. We can test behaviors at the unit and
component scale in a straightforward manner, and validate our expectations that things work the way
we believe they should.
* dev:
  web: bump esbuild from 0.21.1 to 0.21.2 in /web (#9696)
  web: bump chromedriver from 124.0.2 to 124.0.3 in /tests/wdio (#9692)
  website: bump @types/react from 18.3.1 to 18.3.2 in /website (#9691)
  core, web: update translations (#9672)
  core: bump psycopg from 3.1.18 to 3.1.19 (#9698)
  core: bump google-api-python-client from 2.128.0 to 2.129.0 (#9694)
  web: bump the esbuild group in /web with 2 updates (#9695)
  web: bump glob from 10.3.14 to 10.3.15 in /web (#9697)
  core: bump freezegun from 1.5.0 to 1.5.1 (#9693)
  web: fix value handling inside controlled components (#9648)
…testing

* web/automated-testing:
  Adjusting paths to work with tests.
  Rolling back a reversion.
  web: provide a test framework
This commit provides tests alongside the stories for the aggregate cards. The tests are fairly
basic, but they're good enough for starting *and* they provide a pretty good example of how to test
when a promise with a delay is involved.

Two minor fixes in this code:

- The subtext was given a small amount of whitespace above, to remove the crowding that happened.
  It looks much better with a half-rem of space.
- In the rare case that we have a card header with no icon, the ' ' symbol that separates the
  icon from the header is now not rendered. In the previous form, it would push the header to the
  left, making it "hang in space" one rem to the right of the visual line formed by the rightmost
  content border.  The padding between the header, body, and footer is odd; body is 1 rem, the
  header and footer 2rems. This looks good for the graphs, but for the text, not so much.
Copy link

netlify bot commented May 15, 2024

Deploy Preview for authentik-docs canceled.

Name Link
🔨 Latest commit bd6651e
🔍 Latest deploy log https://app.netlify.com/sites/authentik-docs/deploys/66453fd70d526800084fb268

Copy link

netlify bot commented May 15, 2024

Deploy Preview for authentik-storybook ready!

Name Link
🔨 Latest commit bd6651e
🔍 Latest deploy log https://app.netlify.com/sites/authentik-storybook/deploys/66453fd79070dd00089d4885
😎 Deploy Preview https://deploy-preview-9744--authentik-storybook.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@kensternberg-authentik kensternberg-authentik changed the base branch from main to web/cleanup/admin-overview May 15, 2024 23:06
@@ -82,6 +82,7 @@ export class AggregateCard extends AKElement implements IAggregateCard {
text-align: center;
}
.subtext {
margin-top: var(--pf-global--spacer--sm);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

A little more whitespace and breathing room.

<i class="${ifDefined(this.icon)}"></i>&nbsp;${this.renderHeader()}
${this.icon
? html`<i class="${ifDefined(this.icon)}"></i>&nbsp;`
: nothing}${this.renderHeader()}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Don't include the   if there's no icon.

@kensternberg-authentik kensternberg-authentik changed the title Web/cleanup/admin overview testing web: Provide tests for the aggregate cards, fix a few minor things May 15, 2024
Copy link

codecov bot commented May 15, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 92.39%. Comparing base (c46fc3e) to head (bd6651e).

Additional details and impacted files
@@                     Coverage Diff                     @@
##           web/cleanup/admin-overview    #9744   +/-   ##
===========================================================
  Coverage                       92.39%   92.39%           
===========================================================
  Files                             704      704           
  Lines                           34403    34403           
===========================================================
  Hits                            31787    31787           
  Misses                           2616     2616           
Flag Coverage Δ
e2e 49.67% <ø> (+<0.01%) ⬆️
integration 25.36% <ø> (ø)
unit 89.82% <ø> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

github-actions bot commented May 15, 2024

authentik PR Installation instructions

Instructions for docker-compose

Add the following block to your .env file:

AUTHENTIK_IMAGE=ghcr.io/goauthentik/dev-server
AUTHENTIK_TAG=gh-ghcr.io/goauthentik/dev-server:gh-bd6651ebfebae84116761098e6a96576d966f20f
AUTHENTIK_OUTPOSTS__CONTAINER_IMAGE_BASE=ghcr.io/goauthentik/dev-%(type)s:gh-%(build_hash)s

For arm64, use these values:

AUTHENTIK_IMAGE=ghcr.io/goauthentik/dev-server
AUTHENTIK_TAG=gh-ghcr.io/goauthentik/dev-server:gh-bd6651ebfebae84116761098e6a96576d966f20f-arm64
AUTHENTIK_OUTPOSTS__CONTAINER_IMAGE_BASE=ghcr.io/goauthentik/dev-%(type)s:gh-%(build_hash)s

Afterwards, run the upgrade commands from the latest release notes.

Instructions for Kubernetes

Add the following block to your values.yml file:

authentik:
    outposts:
        container_image_base: ghcr.io/goauthentik/dev-%(type)s:gh-%(build_hash)s
image:
    repository: ghcr.io/goauthentik/dev-server
    tag: gh-ghcr.io/goauthentik/dev-server:gh-bd6651ebfebae84116761098e6a96576d966f20f

For arm64, use these values:

authentik:
    outposts:
        container_image_base: ghcr.io/goauthentik/dev-%(type)s:gh-%(build_hash)s
image:
    repository: ghcr.io/goauthentik/dev-server
    tag: gh-ghcr.io/goauthentik/dev-server:gh-bd6651ebfebae84116761098e6a96576d966f20f-arm64

Afterwards, run the upgrade commands from the latest release notes.

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.

None yet

1 participant