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