-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'jak103:main' into main
- Loading branch information
Showing
10 changed files
with
220 additions
and
117 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
export {} | ||
|
||
describe('Profile page tests', () => { | ||
it('should load the page', () => { | ||
cy.visit('http://localhost:9001/#/profile'); | ||
}), | ||
|
||
it('should take me to the edit-profile page', () => { | ||
cy.visit('http://localhost:9001/#/profile'); | ||
cy.get('#edit-profile-button').click(); | ||
cy.url().should('eq', 'http://localhost:9001/#/profile/edit-profile'); | ||
}) | ||
|
||
it('should take me to the replace-image page', () => { | ||
cy.visit('http://localhost:9001/#/profile'); | ||
cy.get('#replace-image-button').click(); | ||
cy.url().should('eq', 'http://localhost:9001/#/profile/replace-image'); | ||
}) | ||
|
||
it('should take me to the C league page', () => { | ||
cy.visit('http://localhost:9001/#/profile'); | ||
cy.get('a[href="#/leagueinfo/C"]').click(); | ||
cy.url().should('eq', 'http://localhost:9001/#/leagueinfo/C'); | ||
}) | ||
|
||
it('should take me to the D league page', () => { | ||
cy.visit('http://localhost:9001/#/profile'); | ||
cy.get('a[href="#/leagueinfo/D"]').click(); | ||
cy.url().should('eq', 'http://localhost:9001/#/leagueinfo/D'); | ||
}) | ||
|
||
it('should take me to the District 5 team page', () => { | ||
cy.visit('http://localhost:9001/#/profile'); | ||
cy.get('a[href="#/teaminfo/District 5"]').click(); | ||
cy.url().should('eq', 'http://localhost:9001/#/teaminfo/District%205'); | ||
}) | ||
|
||
it('should take me to the Trash Pandas team page', () => { | ||
cy.visit('http://localhost:9001/#/profile'); | ||
cy.get('a[href="#/teaminfo/Trash Pandas"]').click(); | ||
cy.url().should('eq', 'http://localhost:9001/#/teaminfo/Trash%20Pandas'); | ||
}) | ||
}) | ||
|
||
describe('Replace image tests', () => { | ||
it('should grow the image', () => { | ||
cy.visit('http://localhost:9001/#/profile/replace-image'); | ||
|
||
cy.get('.q-slider__track') | ||
.trigger('mousedown', 'topRight') | ||
.trigger('mouseup'); | ||
|
||
cy.get('.q-img') | ||
.should('have.attr', 'style') | ||
.and('include', 'width: 220px; height: 220px;') | ||
}); | ||
|
||
it('should shrink the image', () => { | ||
cy.visit('http://localhost:9001/#/profile/replace-image') | ||
cy.get('.q-slider__track-container') | ||
.trigger('mousedown', 'topLeft') | ||
.trigger('mouseup'); | ||
cy.get('.q-img') | ||
.should('have.attr', 'style') | ||
.and('include', 'width: 50px; height: 50px;') | ||
}) | ||
|
||
it('should take you back to the main profile page', () => { | ||
cy.visit('http://localhost:9001/#/profile/replace-image'); | ||
cy.contains('span', 'Cancel').click(); | ||
cy.url().should('eq', 'http://localhost:9001/#/profile'); | ||
}) | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,81 @@ | ||
<template> | ||
<q-page class='row'> | ||
<h5 class="q-mt-lg q-mb-sm q-ml-sm">Teams</h5> | ||
<CardComponent v-for='channel in teams' :key='channel.channel_id' :type='channel.type' :name='channel.channel_name' :unread='channel.missed_chats' :image='channel.channel_image' :link='link'/> | ||
<h5 class="q-mt-lg q-mb-sm q-ml-sm">Leagues</h5> | ||
<CardComponent v-for='channel in leagues' :key='channel.channel_id' :type='channel.type' :name='channel.channel_name' :unread='channel.missed_chats' :image='channel.channel_image' :link='link'/> | ||
<h5 class="q-mt-lg q-mb-sm q-ml-sm">Channels</h5> | ||
<CardComponent v-for='channel in channelType' :key='channel.channel_id' :type='channel.type' :name='channel.channel_name' :unread='channel.missed_chats' :image='channel.channel_image' :link='link'/> | ||
<h5 class="q-mt-lg q-mb-sm q-ml-sm">Direct Messages</h5> | ||
<CardComponent v-for='channel in dms' :key='channel.channel_id' :type='channel.type' :name='channel.channel_name' :unread='channel.missed_chats' :image='channel.channel_image' :link='link'/> | ||
</q-page> | ||
<q-page class="row"> | ||
<h5 class="q-mt-lg q-mb-sm q-ml-sm">Teams</h5> | ||
<CardComponent | ||
v-for="channel in teams" | ||
:key="channel.channel_id" | ||
:type="channel.type" | ||
:name="channel.channel_name" | ||
:unread="channel.missed_chats" | ||
:image="channel.channel_image" | ||
:link="link" | ||
/> | ||
<h5 class="q-mt-lg q-mb-sm q-ml-sm">Leagues</h5> | ||
<CardComponent | ||
v-for="channel in leagues" | ||
:key="channel.channel_id" | ||
:type="channel.type" | ||
:name="channel.channel_name" | ||
:unread="channel.missed_chats" | ||
:image="channel.channel_image" | ||
:link="link" | ||
/> | ||
<h5 class="q-mt-lg q-mb-sm q-ml-sm">Channels</h5> | ||
<CardComponent | ||
v-for="channel in channelType" | ||
:key="channel.channel_id" | ||
:type="channel.type" | ||
:name="channel.channel_name" | ||
:unread="channel.missed_chats" | ||
:image="channel.channel_image" | ||
:link="link" | ||
/> | ||
<h5 class="q-mt-lg q-mb-sm q-ml-sm">Direct Messages</h5> | ||
<CardComponent | ||
v-for="channel in dms" | ||
:key="channel.channel_id" | ||
:type="channel.type" | ||
:name="channel.channel_name" | ||
:unread="channel.missed_chats" | ||
:image="channel.channel_image" | ||
:link="link" | ||
/> | ||
</q-page> | ||
<q-page-sticky position="bottom-right" :offset="[25, 25]"> | ||
<q-btn fab icon="add" color="blue" @click="handleAddChannnel" /> | ||
</q-page-sticky> | ||
</template> | ||
|
||
<script setup lang='ts'> | ||
import { useChannelStore } from 'app/src/stores/channelStore'; | ||
import { onMounted } from 'vue'; | ||
import { defineComponent } from 'vue'; | ||
import { QPage } from 'quasar'; | ||
import CardComponent from '../chat/CardComponent.vue'; | ||
<script setup lang="ts"> | ||
import { useChannelStore } from 'app/src/stores/channelStore'; | ||
import { onMounted } from 'vue'; | ||
import { defineComponent } from 'vue'; | ||
import { QPage } from 'quasar'; | ||
import CardComponent from '../chat/CardComponent.vue'; | ||
import router from 'src/router'; | ||
import { useRouter } from 'vue-router'; | ||
const vrouter = useRouter(); | ||
const channelStore = useChannelStore(); | ||
const { channels } = channelStore; | ||
const link = '/'; | ||
const teams = channels.filter(channel => channel.type === 'team'); | ||
const leagues = channels.filter(channel => channel.type === 'league'); | ||
const channelType = channels.filter(channel => channel.type === 'channel'); | ||
const dms = channels.filter(channel => channel.type === 'dm'); | ||
const channelStore = useChannelStore(); | ||
const { channels } = channelStore; | ||
const link = '/'; | ||
const teams = channels.filter((channel) => channel.type === 'team'); | ||
const leagues = channels.filter((channel) => channel.type === 'league'); | ||
const channelType = channels.filter((channel) => channel.type === 'channel'); | ||
const dms = channels.filter((channel) => channel.type === 'dm'); | ||
defineComponent({ | ||
name: 'ChatPage', | ||
components: { | ||
CardComponent, | ||
}, | ||
}); | ||
function handleAddChannnel() { | ||
vrouter.push({ name: 'CreateChannel' }); | ||
} | ||
onMounted(() => { | ||
console.log('Channels:', channels); | ||
}); | ||
</script> | ||
defineComponent({ | ||
name: 'ChatPage', | ||
components: { | ||
CardComponent, | ||
}, | ||
}); | ||
onMounted(() => { | ||
console.log('Channels:', channels); | ||
}); | ||
</script> |
Oops, something went wrong.