-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #25 from DGB-UNAM-FOLIO/UNAM
Add story Primary Currency Setting
- Loading branch information
Showing
9 changed files
with
127 additions
and
8 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
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,20 @@ | ||
import { | ||
clickable, | ||
collection, | ||
interactor, | ||
text, | ||
} from '@bigtest/interactor'; | ||
|
||
// eslint-disable-next-line import/no-extraneous-dependencies | ||
import SelectInteractor from '@folio/stripes-components/lib/Select/tests/interactor'; | ||
|
||
@interactor class LanguageAndLocalization { | ||
title = text('#config-form [class*=paneTitle---]'); | ||
settings = collection('[class*=row--]', SelectInteractor); | ||
save = clickable('#clickable-save-config'); | ||
selectLocale = new SelectInteractor('#select-locale'); | ||
selectTimeZone = new SelectInteractor('#select-timezone'); | ||
selectCurrency = new SelectInteractor('#select-currency'); | ||
} | ||
|
||
export default LanguageAndLocalization; |
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,10 @@ | ||
|
||
import { Factory, faker } from '@bigtest/mirage'; | ||
|
||
export default Factory.extend({ | ||
id: faker.random.uuid, | ||
module: 'ORG', | ||
configName: 'localeSettings', | ||
enabled: 'true', | ||
value: '{ currency: "USD" }' | ||
}); |
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,3 @@ | ||
import { Model } from '@bigtest/mirage'; | ||
|
||
export default Model.extend(); |
18 changes: 18 additions & 0 deletions
18
test/bigtest/network/scenarios/language-and-localization.js
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,18 @@ | ||
/* istanbul ignore file */ | ||
|
||
export default (server) => { | ||
server.get('/configurations/entries', (schema) => { | ||
return schema.configs.all(); | ||
}); | ||
|
||
server.post('/configurations/entries', (schema, request) => { | ||
const body = JSON.parse(request.requestBody); | ||
return schema.configs.create(body); | ||
}); | ||
|
||
server.put('/configurations/entries/:id', ({ configs }, request) => { | ||
const matching = configs.find(request.params.id); | ||
const body = JSON.parse(request.requestBody); | ||
return matching.update(body); | ||
}); | ||
}; |
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,49 @@ | ||
import { beforeEach, describe, it } from '@bigtest/mocha'; | ||
import { expect } from 'chai'; | ||
import setupApplication from '../helpers/setup-application'; | ||
import LanguageAndLocalization from '../interactors/language-and-localization'; | ||
|
||
describe('Language and localization', () => { | ||
setupApplication({ scenarios: ['language-and-localization'] }); | ||
const lal = new LanguageAndLocalization(); | ||
|
||
beforeEach(function () { | ||
this.visit('/settings/tenant-settings/locale'); | ||
}); | ||
|
||
it('should be present', () => { | ||
expect(lal.title).to.equal('Language and localization'); | ||
}); | ||
describe('Test primary currency', () => { | ||
beforeEach(async function () { | ||
await lal.selectCurrency.selectAndBlur('Canadian Dollar (CAD)'); | ||
await lal.save(); | ||
}); | ||
|
||
it('should be present', () => { | ||
expect(lal.selectCurrency.val).to.equal('CAD'); | ||
}).timeout(2000); | ||
}); | ||
|
||
describe('Test primary locale', () => { | ||
beforeEach(async function () { | ||
await lal.selectLocale.selectAndBlur('Arabic'); | ||
await lal.save(); | ||
}); | ||
|
||
it('should be present', () => { | ||
expect(lal.selectLocale.val).to.equal('ar-AR'); | ||
}).timeout(2000); | ||
}); | ||
|
||
describe('Test primary timezone', () => { | ||
beforeEach(async function () { | ||
await lal.selectTimeZone.selectAndBlur('UTC'); | ||
await lal.save(); | ||
}); | ||
|
||
it('should be present', () => { | ||
expect(lal.selectTimeZone.val).to.equal('UTC'); | ||
}).timeout(2000); | ||
}); | ||
}); |
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