-
Notifications
You must be signed in to change notification settings - Fork 56
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FEATURE]: Afficher l'onglet Formations au clic sur "Voir les formati…
- Loading branch information
Showing
7 changed files
with
85 additions
and
10 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import Service from '@ember/service'; | ||
import { tracked } from '@glimmer/tracking'; | ||
|
||
export default class TabManagerService extends Service { | ||
@tracked activeTab = 0; | ||
|
||
setActiveTab(tab) { | ||
this.activeTab = tab; | ||
} | ||
} |
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,27 @@ | ||
import { setupTest } from 'ember-qunit'; | ||
import { module, test } from 'qunit'; | ||
|
||
module('Unit | Services | TabManager', function (hooks) { | ||
setupTest(hooks); | ||
|
||
module('setActiveTab', function () { | ||
test('default tab', function (assert) { | ||
// given | ||
const tabManagerService = this.owner.lookup('service:tab-manager'); | ||
|
||
// then | ||
assert.strictEqual(tabManagerService.activeTab, 0); | ||
}); | ||
|
||
test('should set active tab to the given tab', function (assert) { | ||
// given | ||
const tabManagerService = this.owner.lookup('service:tab-manager'); | ||
|
||
// when | ||
tabManagerService.setActiveTab(1); | ||
|
||
// then | ||
assert.strictEqual(tabManagerService.activeTab, 1); | ||
}); | ||
}); | ||
}); |