forked from City-of-Helsinki/linkedevents-ui
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bringing Header changes to our Theme branch (#6)
* MUI to Bootstrap Header-component * MUI to boostrap fix * Added Glyphicons to language & login * Added + Glyphicon to add new event * Updating basecode to be on same level as develop (#3) * Fix double encoding City-of-Helsinki#524; with caveat axios/axios#2563 * Display all api results in react select components * Fix event publisher field name for user rights check * Fix City-of-Helsinki#530 * Do not try to update deleted subevents * Do not try to edit past subevents * Refactor editability check; allow deleting and canceling series that contain deleted, canceled or past subevents * Remove unnecessary inlined sub_events at cancel to prevent API errors * Add instructions for internet events * Update snapshots * Add remote participation keyword to all internet events * Add notification about online events to cancel confirmation dialog * Add postpone button and badge * Mention postponing in cancel extra text * Add postpone button to editor too * Show postponed events in search instead of crashing * Update user rights managers * Add missing </p> * Do not remove subevents at cancel after all; deleted items removed by API PR City-of-Helsinki/linkedevents#407 * Fix removed future time validation; fixes City-of-Helsinki#536, City-of-Helsinki#528 * Update snapshots Co-authored-by: Riku Oja <[email protected]> Co-authored-by: Aleksi Salonen <[email protected]> Co-authored-by: Riku Oja <[email protected]> Co-authored-by: aceViilee <[email protected]> * Updated header-component Updated to Reactstrap based on Open design. Updated mobile-functionality. Language dropdown WIP Added Reactstrap stylesheet. Added Reactstrap & Bootstrap packets * Removed React-select language changer, replaced with component Added comment about Nav-update, removed React-select and updated language dropdown with LanguageSelector-component * Fixed padding on language-select Fixed padding to be inline with login * Updated Caret for language selector Added caret and styling * Header updates for changing locale, mobile, styling & components Replaced React-select with custom languageselector for changing locale, changed styling, updated header components (nav logo to brand) & added mobile styling * Updated scss formating Made header scss prettier Co-authored-by: DelusionCB <[email protected]> Co-authored-by: Riku Oja <[email protected]> Co-authored-by: Aleksi Salonen <[email protected]> Co-authored-by: Riku Oja <[email protected]> Co-authored-by: aceViilee <[email protected]>
- Loading branch information
1 parent
a1fdbd2
commit 5f5ac54
Showing
4 changed files
with
307 additions
and
233 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
import React from 'react'; | ||
import {shallow} from 'enzyme'; | ||
import LanguageSelector from './LanguageSelector'; | ||
|
||
const defaultProps = { | ||
languages: [ | ||
{ | ||
label: 'fi', | ||
}, | ||
{ | ||
label: 'en', | ||
}, | ||
{ | ||
label: 'sv', | ||
}, | ||
], | ||
userLocale: { | ||
locale: 'fi', | ||
}, | ||
changeLanguage : () => null, | ||
}; | ||
|
||
describe('languageSelector', () => { | ||
function getWrapper(props) { | ||
return shallow(<LanguageSelector {...defaultProps} {...props} />) | ||
} | ||
describe('acutal test', () => { | ||
test('is default locale', () => { | ||
const element = getWrapper().find('div'); | ||
expect(element).toHaveLength(2); | ||
const sec = element.at(1).find('a'); | ||
expect(sec.text()).toBe('FI'); | ||
}) | ||
|
||
test('activeLocale when en', () => { | ||
const element = getWrapper({userLocale:{locale:'en'}}).find('div').at(1).find('a'); | ||
expect(element.text()).toBe('EN'); | ||
}) | ||
}) | ||
|
||
}) |
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
Oops, something went wrong.