-
Notifications
You must be signed in to change notification settings - Fork 130
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add test case for verified and bloceed stage
- Loading branch information
Showing
2 changed files
with
45 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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'); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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!!!'); | ||
}); | ||
}); |