Skip to content

Commit

Permalink
Implement FieldAffiliationsRorAutoSuggest
Browse files Browse the repository at this point in the history
  • Loading branch information
GaziYucel committed Jan 10, 2025
1 parent fb96c5f commit 2346fc6
Show file tree
Hide file tree
Showing 6 changed files with 204 additions and 389 deletions.
20 changes: 8 additions & 12 deletions src/components/Form/fields/FieldAffiliations.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,32 +2,28 @@ import FieldAffiliations from './FieldAffiliations.vue';
import FieldAffiliationsMock from '@/components/Form/mocks/field-affiliations';
import {http, HttpResponse} from 'msw';

const args = {...FieldAffiliationsMock};

export default {
title: 'Forms/FieldAffiliations',
component: FieldAffiliations,
args: {},
render: (args) => ({
components: {FieldAffiliations},
setup() {
return {args};
},
template: '<FieldAffiliations v-bind="args"/>',
}),
parameters: {
msw: {
handlers: [
http.get(
'https://mock/index.php/publicknowledge/api/v1/rors/?searchPhrase=Simon+Fraser+University',
async () => {
return HttpResponse.json(args.searchResults);
return HttpResponse.json(FieldAffiliationsMock.searchResults);
},
),
],
},
},
render: (args) => ({
components: {FieldAffiliations},
setup() {
return {args};
},
template: `
<FieldAffiliations v-bind="args"/>`,
}),
decorators: [
() => ({
template: '<div style="height: 600px"><story/></div>',
Expand Down
Loading

0 comments on commit 2346fc6

Please sign in to comment.