generated from Real-Dev-Squad/website-template
-
Notifications
You must be signed in to change notification settings - Fork 91
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #448 from Real-Dev-Squad/develop
Dev to Main Sync
- Loading branch information
Showing
6 changed files
with
78 additions
and
63 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
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
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
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
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
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,72 @@ | ||
import { module, test } from 'qunit'; | ||
import { setupRenderingTest } from 'ember-qunit'; | ||
import { render } from '@ember/test-helpers'; | ||
import { hbs } from 'ember-cli-htmlbars'; | ||
|
||
module('Integration | Component | user-status', function (hooks) { | ||
setupRenderingTest(hooks); | ||
|
||
test('show relevant data when status is ONBOARDING', async function (assert) { | ||
this.setProperties({ | ||
changeStatus: () => {}, | ||
updateStatus: () => {}, | ||
status: 'ONBOARDING', | ||
isStatusUpdating: false, | ||
}); | ||
|
||
await render(hbs` | ||
<UserStatus | ||
@status={{this.status}} | ||
@changeStatus={{this.changeStatus}} | ||
@isStatusUpdating={{this.isStatusUpdating}} | ||
@updateStatus={{this.updateStatus}} | ||
/> | ||
`); | ||
|
||
assert.dom('[data-test-onboarding-details]').exists(); | ||
assert.dom('[data-test-status]').hasText('You are undergoing onboarding'); | ||
}); | ||
|
||
test('show relevant data when status is IDLE', async function (assert) { | ||
this.setProperties({ | ||
changeStatus: () => {}, | ||
updateStatus: () => {}, | ||
status: 'IDLE', | ||
isStatusUpdating: false, | ||
}); | ||
|
||
await render(hbs` | ||
<UserStatus | ||
@status={{this.status}} | ||
@changeStatus={{this.changeStatus}} | ||
@isStatusUpdating={{this.isStatusUpdating}} | ||
@updateStatus={{this.updateStatus}} | ||
/> | ||
`); | ||
|
||
assert.dom('[data-test-status]').hasText(`You are Idle`); | ||
assert | ||
.dom('[data-test-update-status-OOO]') | ||
.hasText('Change your status to OOO'); | ||
}); | ||
|
||
test('show relevant data when status is OOO', async function (assert) { | ||
this.setProperties({ | ||
status: 'OOO', | ||
isStatusUpdating: false, | ||
changeStatus: () => {}, | ||
updateStatus: () => {}, | ||
}); | ||
|
||
await render(hbs` | ||
<UserStatus | ||
@status={{this.status}} | ||
@changeStatus={{this.changeStatus}} | ||
@isStatusUpdating={{this.isStatusUpdating}} | ||
@updateStatus={{this.updateStatus}} | ||
/> | ||
`); | ||
|
||
assert.dom('[data-test-status]').hasText(`You are OOO`); | ||
}); | ||
}); |