Skip to content

Commit

Permalink
feat: add test case for verified and bloceed stage
Browse files Browse the repository at this point in the history
  • Loading branch information
tejaskh3 committed Jan 5, 2025
1 parent 1fa406c commit be98300
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 0 deletions.
26 changes: 26 additions & 0 deletions tests/integration/components/identity/blocked.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import { module, test } from 'qunit';
import { setupRenderingTest } from 'website-www/tests/helpers';
import { render, click } from '@ember/test-helpers';
import { hbs } from 'ember-cli-htmlbars';

module('Integration | Component | identity/blocked', function (hooks) {
setupRenderingTest(hooks);

test('it renders the initial state correctly', async function (assert) {
await render(hbs`<Identity::Blocked />`);

assert.dom('[data-test-blocked-heading]').hasText('Status Blocked');
assert.dom('[data-test-blocked-desc]').exists();
assert.dom('[data-test-blocked-button]').hasText('Retry');
});

test('it handles retry button click', async function (assert) {
let retryClicked = false;
this.set('setState', () => (retryClicked = true));
await render(hbs`<Identity::Blocked @setState={{this.setState}} />`);

await click('[data-test-blocked-button]');

assert.true(retryClicked, 'Retry button should trigger setState');
});
});
19 changes: 19 additions & 0 deletions tests/integration/components/identity/verified.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import { module, test } from 'qunit';
import { setupRenderingTest } from 'website-www/tests/helpers';
import { render } from '@ember/test-helpers';
import { hbs } from 'ember-cli-htmlbars';

module('Integration | Component | identity/verified', function (hooks) {
setupRenderingTest(hooks);

test('it renders the success message correctly', async function (assert) {
await render(hbs`<Identity::Verified />`);

assert.dom('[data-test-verified-heading]').hasText('Verified');
assert.dom('[data-test-verified-desc]').exists();
assert
.dom('[data-test-verified-desc] span')
.hasClass('identity-box-desc-bold');
assert.dom('[data-test-verified-desc] span').hasText('Congratulations!!!');
});
});

0 comments on commit be98300

Please sign in to comment.