From be98300d9a166339f7d9f85f88d29261ee3a11ce Mon Sep 17 00:00:00 2001 From: tejaskh3 Date: Sun, 5 Jan 2025 19:27:13 +0530 Subject: [PATCH] feat: add test case for verified and bloceed stage --- .../components/identity/blocked.js | 26 +++++++++++++++++++ .../components/identity/verified.js | 19 ++++++++++++++ 2 files changed, 45 insertions(+) create mode 100644 tests/integration/components/identity/blocked.js create mode 100644 tests/integration/components/identity/verified.js diff --git a/tests/integration/components/identity/blocked.js b/tests/integration/components/identity/blocked.js new file mode 100644 index 00000000..83b9051c --- /dev/null +++ b/tests/integration/components/identity/blocked.js @@ -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``); + + 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``); + + await click('[data-test-blocked-button]'); + + assert.true(retryClicked, 'Retry button should trigger setState'); + }); +}); diff --git a/tests/integration/components/identity/verified.js b/tests/integration/components/identity/verified.js new file mode 100644 index 00000000..da908c34 --- /dev/null +++ b/tests/integration/components/identity/verified.js @@ -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``); + + 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!!!'); + }); +});