Skip to content

Commit

Permalink
Showing 2 changed files with 0 additions and 37 deletions.
4 changes: 0 additions & 4 deletions certif/app/components/layout/sidebar.gjs
Original file line number Diff line number Diff line change
@@ -6,15 +6,11 @@ import { t } from 'ember-intl';

const LINK_SCO = 'http://cloud.pix.fr/s/GqwW6dFDDrHezfS';
const LINK_OTHER = 'http://cloud.pix.fr/s/fLSG4mYCcX7GDRF';
const LINK_V3_PILOT = 'https://cloud.pix.fr/s/f2PNGLajBypbaiJ';

export default class Sidebar extends Component {
@service currentUser;

get documentationLink() {
if (this.currentUser.currentAllowedCertificationCenterAccess.isV3Pilot) {
return LINK_V3_PILOT;
}
if (this.currentUser.currentAllowedCertificationCenterAccess.isScoManagingStudents) {
return LINK_SCO;
}
33 changes: 0 additions & 33 deletions certif/tests/integration/components/layout/sidebar_test.gjs
Original file line number Diff line number Diff line change
@@ -9,7 +9,6 @@ import setupRenderingIntlTest from '../../../helpers/setup-intl-rendering';

const LINK_SCO = 'http://cloud.pix.fr/s/GqwW6dFDDrHezfS';
const LINK_OTHER = 'http://cloud.pix.fr/s/fLSG4mYCcX7GDRF';
const LINK_V3_PILOT = 'https://cloud.pix.fr/s/f2PNGLajBypbaiJ';

module('Integration | Component | Layout | Sidebar', function (hooks) {
setupRenderingIntlTest(hooks);
@@ -93,38 +92,6 @@ module('Integration | Component | Layout | Sidebar', function (hooks) {
.hasAttribute('href', LINK_OTHER);
});

test('should return the dedicated link for V3 pilot certification center', async function (assert) {
// given
const store = this.owner.lookup('service:store');
const currentAllowedCertificationCenterAccess = store.createRecord('allowed-certification-center-access', {
id: '789',
name: 'AllowedCenter',
type: 'SCO',
isRelatedToManagingStudentsOrganization: true,
isV3Pilot: true,
});
certificationPointOfContact = {
firstName: 'Alain',
lastName: 'Proviste',
};

class CurrentUserStub extends Service {
currentAllowedCertificationCenterAccess = currentAllowedCertificationCenterAccess;
certificationPointOfContact = certificationPointOfContact;
updateCurrentCertificationCenter = sinon.stub();
}

this.owner.register('service:current-user', CurrentUserStub);

// when
const screen = await render(<template><Sidebar /></template>);

// then
assert
.dom(screen.getByRole('link', { name: t('navigation.main.documentation') }))
.hasAttribute('href', LINK_V3_PILOT);
});

test('should return the dedicated link for SCO isManagingStudents certification center', async function (assert) {
// given
const store = this.owner.lookup('service:store');

0 comments on commit 9e5dcef

Please sign in to comment.