fixes to cypress test of friends list

This commit is contained in:
Nuwan 2023-11-02 17:00:45 +05:30
parent f42383f0b4
commit c108bdd058
3 changed files with 9 additions and 7 deletions

View File

@ -372,10 +372,10 @@ describe('Friends page with data', () => {
messageFixtures.forEach(fixture => {
cy.fixture(fixture).then(json => {
cy.intercept('GET', /\S+\/text_messages\S+/, json);
cy.get('.modal-body .ScrollbarsCustom')
cy.get('.modal-body .ScrollbarsCustom-Scroller')
.trigger('mouseover')
.scrollTo('bottom');
cy.get('.modal-body .ScrollbarsCustom')
cy.get('.modal-body .ScrollbarsCustom-Scroller')
.trigger('mouseover')
.scrollTo('top');
numberOfMessages = numberOfMessages + 10;
@ -449,19 +449,19 @@ describe('Friends page with data', () => {
});
describe('coming from email links', () => {
it.only("opens details sidebar", () => {
it("opens details sidebar", () => {
cy.visit('/friends?open=details&id=1');
showSidePanelContent();
});
it.only("opens chat window", () => {
it("opens chat window", () => {
cy.visit('/friends?open=message&id=1');
cy.get('[data-testid=textMessageModal]')
.should('be.visible')
cy.contains('Send Message to Test User1').should('exist');
});
it.only("sends friend request", () => {
it("sends friend request", () => {
cy.intercept('GET', /\S+\/profile\S+/, { fixture: 'person' });
cy.intercept('POST', /\S+\/friend_requests/, { statusCode: 201, body: { ok: true } });
cy.visit('/friends?open=connect&id=1');

View File

@ -71,7 +71,7 @@ describe('Create new session', () => {
cy.get('[data-testid=session-description]').contains('My test session')
})
it.only("submits form", () => {
it("submits form", () => {
const newUrl = `jamkazam://url=http://www.jamkazam.local:3000/client#/createSession/custom~yes%7Cprivacy~2%7Cdescription~test%7CinviteeIds~1`;
cy.visit('/sessions/new').then((win) => {
cy.stub(win, 'open').as('windowOpen');

View File

@ -152,6 +152,7 @@ function JKPeopleFilter() {
};
const onSubmit = (data) => {
//console.log("_DEBUG_ page.current", page.current)
let genres = [];
let joined_within_days = '';
let active_within_days = '';
@ -171,7 +172,7 @@ function JKPeopleFilter() {
try {
if(page.current === 0){
dispatch(fetchPeople({ data: params.current, offset: offset || 0, limit: perPageLimit }));
dispatch(fetchPeople({ data: params.current, offset: 0, limit: perPageLimit }));
page.current += 1
}else{
if(prefetched.length > 0){
@ -196,6 +197,7 @@ function JKPeopleFilter() {
page.current = 0
submitPageQuery()
}else{
console.log("_DEBUG_ after loadingStatus changed. page.current", page.current, hasNextPage(), offset)
if (page.current === 1 && hasNextPage()) {
dispatch(preFetchPeople({ data: params.current, offset, limit: perPageLimit }));
page.current += 1;