Skip to content

Commit

Permalink
chore(editor): fix failing test
Browse files Browse the repository at this point in the history
  • Loading branch information
jahow committed Nov 7, 2024
1 parent 9629cc5 commit d415607
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ describe('FormFieldLicenseComponent', () => {
fixture = TestBed.createComponent(FormFieldLicenseComponent)
component = fixture.componentInstance
component.label = 'License' // TODO: translate
component.value = [{ text: 'cc-by' }]
component.recordConstraints = [{ text: 'cc-by' }]
fixture.detectChanges()
})

Expand All @@ -24,13 +24,13 @@ describe('FormFieldLicenseComponent', () => {
})
describe('#selected', () => {
it('should get the selected value', () => {
expect(component.selected).toBe('cc-by')
expect(component.selectedLicence).toBe('cc-by')
})
})
describe('#onSelectValue', () => {
it('should emit the selected value', () => {
const spy = jest.spyOn(component.valueChange, 'emit')
component.onSelectValue('cc-by-sa')
const spy = jest.spyOn(component.recordConstraintsChange, 'emit')
component.handleLicenceSelection('cc-by-sa')
expect(spy).toHaveBeenCalledWith([{ text: 'cc-by-sa' }])
})
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { FormFieldOpenDataComponent } from './form-field-open-data.component'

jest.mock('./../../../../fields.config', () => {
return {
OPEN_DATA_LICENSES: ['CC-BY'],
OPEN_DATA_LICENSE: 'CC-BY',
}
})

Expand Down

0 comments on commit d415607

Please sign in to comment.