This commit is contained in:
parent
675b764c82
commit
d99d934dab
|
@ -78,6 +78,7 @@ defineExpose({
|
|||
<div class="q-mt-lg row justify-end">
|
||||
<QBtn
|
||||
:label="t('globals.save')"
|
||||
:title="t('globals.save')"
|
||||
type="submit"
|
||||
color="primary"
|
||||
:disabled="isLoading"
|
||||
|
@ -85,6 +86,7 @@ defineExpose({
|
|||
/>
|
||||
<QBtn
|
||||
:label="t('globals.cancel')"
|
||||
:title="t('globals.cancel')"
|
||||
type="reset"
|
||||
color="primary"
|
||||
flat
|
||||
|
|
|
@ -78,6 +78,7 @@ const arrayData = useArrayData(props.dataKey, {
|
|||
userParams: props.userParams,
|
||||
exprBuilder: props.exprBuilder,
|
||||
});
|
||||
const hasMoreData = ref();
|
||||
const store = arrayData.store;
|
||||
|
||||
onMounted(() => {
|
||||
|
@ -106,7 +107,6 @@ async function paginate() {
|
|||
|
||||
isLoading.value = true;
|
||||
await arrayData.loadMore();
|
||||
|
||||
if (!arrayData.hasMoreData.value) {
|
||||
if (store.userParamsChanged) arrayData.hasMoreData.value = true;
|
||||
store.userParamsChanged = false;
|
||||
|
@ -124,6 +124,7 @@ async function paginate() {
|
|||
}
|
||||
|
||||
function endPagination() {
|
||||
hasMoreData.value = arrayData.hasMoreData.value;
|
||||
isLoading.value = false;
|
||||
emit('onFetch', store.data);
|
||||
emit('onPaginate');
|
||||
|
@ -190,10 +191,7 @@ async function onLoad(index, done) {
|
|||
<QSpinner color="orange" size="md" />
|
||||
</div>
|
||||
</QInfiniteScroll>
|
||||
<div
|
||||
v-if="!isLoading && arrayData.hasMoreData"
|
||||
class="w-full flex justify-center q-mt-md"
|
||||
>
|
||||
<div v-if="!isLoading && hasMoreData" class="w-full flex justify-center q-mt-md">
|
||||
<QBtn color="primary" :label="t('Load more data')" @click="paginate()" />
|
||||
</div>
|
||||
</template>
|
||||
|
|
|
@ -5,37 +5,40 @@ describe('WagonTypeCreate', () => {
|
|||
cy.viewport(1920, 1080);
|
||||
cy.login('developer');
|
||||
cy.visit(`/#/entry/${entryId}/dms`);
|
||||
|
||||
});
|
||||
|
||||
it('should create edit and remove new dms', () => {
|
||||
cy.addRow();
|
||||
cy.get('.icon-attach').click()
|
||||
cy.get('.icon-attach').click();
|
||||
cy.get('.q-file').selectFile('test/cypress/fixtures/image.jpg', {
|
||||
force: true,
|
||||
});
|
||||
|
||||
cy.get("tbody > tr").then((value) => {
|
||||
cy.get('tbody > tr').then((value) => {
|
||||
const u = undefined;
|
||||
|
||||
//Create and check if exist new row
|
||||
let newFileTd = Cypress.$(value).length;
|
||||
cy.get('.q-btn--standard > .q-btn__content > .block').click();
|
||||
expect(value).to.have.length(newFileTd++);
|
||||
const newRowSelector = `tbody > :nth-child(${newFileTd})`
|
||||
const newRowSelector = `tbody > :nth-child(${newFileTd})`;
|
||||
cy.waitForElement(newRowSelector);
|
||||
cy.validateRow(newRowSelector, [u, u, u, u, 'ENTRADA ID 1']);
|
||||
|
||||
//Edit new dms
|
||||
const u = undefined;
|
||||
cy.validateRow(newRowSelector, [u,u,u,u,'ENTRADA ID 1'])
|
||||
cy.get(`tbody :nth-child(${newFileTd}) > .text-right > .flex > :nth-child(2) > .q-btn > .q-btn__content > .q-icon`).click();
|
||||
})
|
||||
// cy.log('newFileTd', newFileTd)
|
||||
const newDescription = 'entry id 1 modified';
|
||||
const textAreaSelector =
|
||||
'.q-textarea > .q-field__inner > .q-field__control > .q-field__control-container';
|
||||
cy.get(
|
||||
`tbody :nth-child(${newFileTd}) > .text-right > .no-wrap > :nth-child(2) > .q-btn > .q-btn__content > .q-icon`
|
||||
).click();
|
||||
|
||||
// //Create and check if exist new row
|
||||
// cy.log('newFileTd:', newFileTd);
|
||||
// cy.get(`tbody :nth-child(${newFileTd}) > .text-right > .flex > :nth-child(2) > .q-btn > .q-btn__content > .q-icon`).click()
|
||||
cy.get(textAreaSelector).clear();
|
||||
cy.get(textAreaSelector).type(newDescription);
|
||||
cy.saveCard();
|
||||
cy.reload();
|
||||
|
||||
// cy.get(`tbody :nth-child(${newFileTd}) > :nth-child(5) > .q-tr > :nth-child(1) > span`).then((value) => {
|
||||
// cy.log(value)
|
||||
// });
|
||||
cy.validateRow(newRowSelector, [u, u, u, u, newDescription]);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
|
@ -8,9 +8,9 @@ describe('WorkerList', () => {
|
|||
});
|
||||
|
||||
it('should load workers', () => {
|
||||
cy.get(workerFieldNames).eq(0).should('have.text', 'JessicaJones');
|
||||
cy.get(workerFieldNames).eq(1).should('have.text', 'BruceBanner');
|
||||
cy.get(workerFieldNames).eq(2).should('have.text', 'CharlesXavier');
|
||||
cy.get(workerFieldNames).eq(0).should('have.text', 'jessicajones');
|
||||
cy.get(workerFieldNames).eq(1).should('have.text', 'brucebanner');
|
||||
cy.get(workerFieldNames).eq(2).should('have.text', 'charlesxavier');
|
||||
});
|
||||
|
||||
it('should open the worker summary', () => {
|
||||
|
|
|
@ -60,7 +60,6 @@ describe('WorkerNotificationsManager', () => {
|
|||
it('should active a notification if you are their boss', () => {
|
||||
cy.login('salesBoss');
|
||||
cy.visit(`/#/worker/${salesPersonId}/notifications`);
|
||||
cy.waitForElement(activeList);
|
||||
cy.waitForElement(availableList);
|
||||
|
||||
cy.get(activeList)
|
||||
|
|
|
@ -6,7 +6,8 @@ describe('WorkerSummary', () => {
|
|||
});
|
||||
|
||||
it('should load worker summary', () => {
|
||||
cy.get('.summaryHeader > div').should('have.text', '19 - salesBoss salesBoss');
|
||||
cy.waitForElement('.summaryHeader');
|
||||
cy.get('.summaryHeader > div').should('have.text', '19 - salesboss salesboss');
|
||||
cy.get(':nth-child(1) > :nth-child(2) > .value > span').should(
|
||||
'have.text',
|
||||
'salesBossNick'
|
||||
|
|
Loading…
Reference in New Issue