Skip to content

Commit

Permalink
feat: fix e2e tests
Browse files Browse the repository at this point in the history
  • Loading branch information
flaminic committed Nov 12, 2024
1 parent ae1cd24 commit ad1d137
Show file tree
Hide file tree
Showing 35 changed files with 264 additions and 1,187 deletions.
4 changes: 2 additions & 2 deletions collections/forms/i18n/en.pot
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ msgstr ""
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1)\n"
"POT-Creation-Date: 2024-09-09T12:09:30.724Z\n"
"PO-Revision-Date: 2024-09-09T12:09:30.724Z\n"
"POT-Creation-Date: 2024-11-12T09:49:07.571Z\n"
"PO-Revision-Date: 2024-11-12T09:49:07.571Z\n"

msgid "Upload file"
msgstr "Upload file"
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { options } from './common/options.js'
import { statefulDecorator } from './common/stateful-decorator.js'

export default {
title: 'Simple Transfer Disabled SimpleTransfer Buttons',
title: 'SimpleTransfer Disabled SimpleTransfer Buttons',
decorators: [statefulDecorator()],
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { options } from './common/options.js'
import { statefulDecorator } from './common/stateful-decorator.js'

export default {
title: 'Simple Transfer Disabled Source Options',
title: 'SimpleTransfer Disabled Source Options',
decorators: [statefulDecorator()],
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { SimpleTransfer } from '../simple-transfer.js'
import { options } from './common/options.js'
import { statefulDecorator } from './common/stateful-decorator.js'

export default { title: 'Simple Transfer Display Order' }
export default { title: 'SimpleTransfer Display Order' }

window.options = options

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { options } from './common/options.js'
import { statefulDecorator } from './common/stateful-decorator.js'

export default {
title: 'Simple Transfer filtering',
title: 'SimpleTransfer filtering',
decorators: [statefulDecorator()],
}

Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React from 'react'
import { SimpleTransfer } from '../simple-transfer.js'
import { options } from './common/options.js'

export default { title: 'Simple Transfer Loading Lists' }
export default { title: 'SimpleTransfer Loading Lists' }

export const LoadingSource = () => (
<SimpleTransfer
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import React from 'react'
import React, { useState } from 'react'
import { SimpleTransfer } from '../simple-transfer.js'
import { options } from './common/options.js'
import { statefulDecorator } from './common/stateful-decorator.js'

export default {
title: 'Simple Transfer End Of List',
title: 'SimpleTransfer End Of List',
decorators: [statefulDecorator()],
}

Expand All @@ -16,23 +16,37 @@ window.onEndReachedPicked = window.Cypress
? window.Cypress.cy.stub()
: () => console.log('onEndReachedPicked')

export const FullSourceList = (_, { selected, onChange }) => (
<SimpleTransfer
options={options}
selected={selected}
onChange={onChange}
onEndReached={window.onEndReached}
/>
)
export const FullSourceList = (_, { selected, onChange }) => {
const [shownOptions, setShownOptions] = useState(options.slice(0, 4))

export const FullPickedList = (_, { selected, onChange }) => (
<SimpleTransfer
options={options}
selected={selected}
onChange={onChange}
onEndReachedPicked={window.onEndReachedPicked}
/>
)
return (
<SimpleTransfer
options={shownOptions}
selected={selected}
onChange={onChange}
onEndReached={() => {
setShownOptions(options)
window.onEndReached()
}}
/>
)
}

export const FullPickedList = (_, { selected, onChange }) => {
const [shownOptions, setShownOptions] = useState(options.slice(0, 4))

return (
<SimpleTransfer
options={shownOptions}
selected={selected}
onChange={onChange}
onEndReachedPicked={() => {
setShownOptions(options)
window.onEndReachedPicked()
}}
/>
)
}

FullPickedList.story = {
decorators: [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { SimpleTransfer } from '../simple-transfer.js'
import { options } from './common/options.js'
import { statefulDecorator } from './common/stateful-decorator.js'

export default { title: 'Simple Transfer Reorder Buttons' }
export default { title: 'SimpleTransfer Reorder Buttons' }

export const HasSomeSelected = (_, { selected, onChange }) => (
<SimpleTransfer
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { options } from './common/options.js'
import { statefulDecorator } from './common/stateful-decorator.js'

export default {
title: 'Simple Transfer Transferring Items',
title: 'SimpleTransfer Transferring Items',
decorators: [statefulDecorator()],
}

Expand Down

This file was deleted.

This file was deleted.

Loading

0 comments on commit ad1d137

Please sign in to comment.