Skip to content

Commit

Permalink
fix(KUI-1519): fix to correct config name for "memoStorageUri" (shoul…
Browse files Browse the repository at this point in the history
…d not be be uppercase URI)
  • Loading branch information
karlandindrakryggen committed Oct 10, 2024
1 parent c9adee5 commit bd0c260
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export const CourseMemoLink = ({ courseCode, courseRound }) => {
return (
<div>
{round_memoFile ? (
<a href={`${browserConfig.memoStorageURI}${round_memoFile.fileName}`} target="_blank" rel="noreferrer">
<a href={`${browserConfig.memoStorageUri}${round_memoFile.fileName}`} target="_blank" rel="noreferrer">
{translation.courseLabels.label_link_course_memo}
</a>
) : (
Expand Down
8 changes: 4 additions & 4 deletions public/js/app/components/__tests__/CourseMemoLink.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { useWebContext } from '../../context/WebContext'

describe('Component <CourseMemoLink>', () => {
test('renders course offering memo link correctly if there is an available course memo as pdf', () => {
useWebContext.mockReturnValue({ lang: 'en', browserConfig: { memoStorageURI: 'https://test.com/' } })
useWebContext.mockReturnValue({ lang: 'en', browserConfig: { memoStorageUri: 'https://test.com/' } })
const [translate] = i18n.messages // en

const propsWithMemoFile = {
Expand All @@ -26,11 +26,11 @@ describe('Component <CourseMemoLink>', () => {
})

test('renders course offering memo link correctly to web-based course memos', () => {
useWebContext.mockReturnValue({ lang: 'en', browserConfig: { memoStorageURI: 'https://test.com/' } })
useWebContext.mockReturnValue({ lang: 'en', browserConfig: { memoStorageUri: 'https://test.com/' } })
const [translate] = i18n.messages // en
const propsWithMemoFile = {
courseCode: 'ABC123',
memoStorageURI: 'https://test.com/',
memoStorageUri: 'https://test.com/',
courseRound: { round_memoFile: { fileName: 'test', fileDate: '1970-01-01' } },
}
const propsWithMemoWebPage = {
Expand All @@ -53,7 +53,7 @@ describe('Component <CourseMemoLink>', () => {
})

test('renders course offering memo link to pdf if it exists among other data and correctly prioriterized', () => {
useWebContext.mockReturnValue({ lang: 'en', browserConfig: { memoStorageURI: 'https://test.com/' } })
useWebContext.mockReturnValue({ lang: 'en', browserConfig: { memoStorageUri: 'https://test.com/' } })
const [translate] = i18n.messages // en
const propsWithMemoFileAndOtherInfo = {
courseCode: 'KIP1111',
Expand Down
14 changes: 7 additions & 7 deletions public/js/app/components/__tests__/RoundInformation.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ describe('Component <RoundInformation>', () => {

test('renders study pace correctly', () => {
const propsWithStudyPace = {
memoStorageURI: '',
memoStorageUri: '',
semesterRoundState: defaultSemesterRoundState,
courseData: {},
courseRound: {
Expand All @@ -65,7 +65,7 @@ describe('Component <RoundInformation>', () => {
const responsiblesData = 'Responsibles’ data'
const teachersData = 'Teachers’ data'
const propsWithEmployees = {
memoStorageURI: '',
memoStorageUri: '',
semesterRoundState: defaultSemesterRoundState,
courseData: {},
courseCode: 'SF1624',
Expand Down Expand Up @@ -95,7 +95,7 @@ describe('Component <RoundInformation>', () => {

test('renders information about missing course employees in course offering because it contains empty string', () => {
const propsWithEmptyEmployees = {
memoStorageURI: '',
memoStorageUri: '',
semesterRoundState: defaultSemesterRoundState,
courseData: {},
courseCode: 'SF1624',
Expand All @@ -113,7 +113,7 @@ describe('Component <RoundInformation>', () => {

test('renders information about missing course employees in course offering because no data about employees is provided', () => {
const propsWithoutEmployees = {
memoStorageURI: '',
memoStorageUri: '',
semesterRoundState: defaultSemesterRoundState,
courseData: {},
courseCode: 'SF1624',
Expand All @@ -131,7 +131,7 @@ describe('Component <RoundInformation>', () => {

test('renders course offering number of places correctly if all data is available', async () => {
const propsWithSeatsNum = {
memoStorageURI: '',
memoStorageUri: '',
semesterRoundState: defaultSemesterRoundState,
courseData: {},
courseRound: {
Expand Down Expand Up @@ -169,7 +169,7 @@ describe('Component <RoundInformation>', () => {

test('renders default text and hide info icon if a course offering number of places is not provided', () => {
const propsWithoutSeatsNum = {
memoStorageURI: '',
memoStorageUri: '',
semesterRoundState: defaultSemesterRoundState,
courseData: {},
courseRound: {
Expand Down Expand Up @@ -198,7 +198,7 @@ describe('Component <RoundInformation>', () => {

test('renders course offering number of places correctly and default text in modal if selection criteria is empty', async () => {
const propsWithEmptyCriteria = {
memoStorageURI: '',
memoStorageUri: '',
semesterRoundState: defaultSemesterRoundState,
courseData: {},
courseRound: {
Expand Down

0 comments on commit bd0c260

Please sign in to comment.