vault/ui/tests/integration/components/auth/page/setup-test-context.js
claire bontempo e80d0ac68c
UI: Auth test cleanup to prep for auth service refactor (#30949)
* update test helpers, export DELAY_IN_MS, make window event a helper

* simplify auth method map helpers, move page tests into separate files

* use new buttons

* finish separating page tests

* move test helpers back to relevant files

* remove redundant oidc test

* move misplaced linked block AUTH_FORM selector

* i definitely already addressed these..

* comment meant remove "trailing" forward slash...lol

* cleanup stubs
2025-06-12 09:46:45 -07:00

34 lines
1023 B
JavaScript

/**
* Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: BUSL-1.1
*/
import { render } from '@ember/test-helpers';
import hbs from 'htmlbars-inline-precompile';
import sinon from 'sinon';
export default (context) => {
context.version = context.owner.lookup('service:version');
context.cluster = { id: '1' };
context.directLinkData = null;
context.loginSettings = null;
context.namespaceQueryParam = '';
context.oidcProviderQueryParam = '';
context.onAuthSuccess = sinon.spy();
context.onNamespaceUpdate = sinon.spy();
context.visibleAuthMounts = false;
context.renderComponent = () => {
return render(hbs`<Auth::Page
@cluster={{this.cluster}}
@directLinkData={{this.directLinkData}}
@loginSettings={{this.loginSettings}}
@namespaceQueryParam={{this.namespaceQueryParam}}
@oidcProviderQueryParam={{this.oidcProviderQueryParam}}
@onAuthSuccess={{this.onAuthSuccess}}
@onNamespaceUpdate={{this.onNamespaceUpdate}}
@visibleAuthMounts={{this.visibleAuthMounts}}
/>`);
};
};