Skip to content

Commit

Permalink
feat(certif): Change SCO PixBanner to PixNotification
Browse files Browse the repository at this point in the history
  • Loading branch information
AndreiaPena committed Dec 17, 2024
1 parent b5482e9 commit eca3fca
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 4 deletions.
5 changes: 3 additions & 2 deletions certif/app/components/layout/banners.gjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import PixBannerAlert from '@1024pix/pix-ui/components/pix-banner-alert';
import PixNotificationAlert from '@1024pix/pix-ui/components/pix-notification-alert';
import { action } from '@ember/object';
import { service } from '@ember/service';
import Component from '@glimmer/component';
Expand Down Expand Up @@ -36,9 +37,9 @@ export default class Banners extends Component {

<template>
{{#if this.shouldDisplaySCOInformationBanner}}
<PixBannerAlert @canCloseBanner='true' class='banners'>
<PixNotificationAlert @type='information' @withIcon={{true}} class='banners'>
{{t 'pages.sco.banner.information' htmlSafe=true}}
</PixBannerAlert>
</PixNotificationAlert>
{{/if}}

{{#if this.shouldDisplayLocaleNotSupportedBanner}}
Expand Down
20 changes: 18 additions & 2 deletions certif/tests/integration/components/layout/banners_test.gjs
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,15 @@ module('Integration | Component | Layout | Banners', function (hooks) {
const screen = await render(<template><Banners /></template>);

// then
assert.dom(screen.queryByRole('alert')).exists();
assert
.dom(
screen.getByText(
(content) =>
content.startsWith('La Certification Pix se déroulera du 7 novembre 2024 au 7 mars 2025 ') &&
content.endsWith('Collèges : du 17 mars au 13 juin 2025.'),
),
)
.exists();
});
});

Expand Down Expand Up @@ -185,7 +193,15 @@ module('Integration | Component | Layout | Banners', function (hooks) {
const screen = await render(<template><Banners /></template>);

// then
assert.dom(screen.queryByRole('alert')).doesNotExist();
assert
.dom(
screen.queryByText(
(content) =>
content.startsWith('La Certification Pix se déroulera du 7 novembre 2024 au 7 mars 2025 ') &&
content.endsWith('Collèges : du 17 mars au 13 juin 2025.'),
),
)
.doesNotExist();
});
});
});
Expand Down

0 comments on commit eca3fca

Please sign in to comment.