Skip to content

Commit

Permalink
Merge pull request #32 from RyanBirtch-aot/main
Browse files Browse the repository at this point in the history
Sync with main branch
  • Loading branch information
abhilash-aot authored Nov 21, 2024
2 parents 2110031 + 68bd7c3 commit afb3639
Show file tree
Hide file tree
Showing 7 changed files with 534 additions and 131 deletions.
4 changes: 3 additions & 1 deletion app/frontend/src/components/designer/FormViewer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,9 @@ const { authenticated, keycloak, tokenParsed, user } = storeToRefs(authStore);
const { downloadedFile, isRTL } = storeToRefs(formStore);
const formScheduleExpireMessage = computed(() =>
t('trans.formViewer.formScheduleExpireMessage')
form?.value?.schedule?.message
? form.value.schedule.message
: t('trans.formViewer.formScheduleExpireMessage')
);
const formUnauthorizedMessage = computed(() =>
Expand Down
12 changes: 11 additions & 1 deletion app/frontend/tests/unit/components/designer/FormViewer.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ describe('FormViewer.vue', () => {
getDispositionSpy.mockImplementation(() => {});
});

it('formScheduleExpireMessage returns the formScheduleExpireMessage translation', async () => {
it('formScheduleExpireMessage returns the formScheduleExpireMessage translation or custom message', async () => {
const wrapper = shallowMount(FormViewer, {
props: {
formId: formId,
Expand All @@ -187,9 +187,19 @@ describe('FormViewer.vue', () => {

await flushPromises();

wrapper.vm.form = {};

expect(wrapper.vm.formScheduleExpireMessage).toEqual(
'trans.formViewer.formScheduleExpireMessage'
);

wrapper.vm.form = {
schedule: {
message: 'custom message',
},
};

expect(wrapper.vm.formScheduleExpireMessage).toEqual('custom message');
});

it('formUnauthorizedMessage returns the formUnauthorizedMessage translation', async () => {
Expand Down
60 changes: 30 additions & 30 deletions app/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit afb3639

Please sign in to comment.