diff --git a/integration-test/tests/cms/codeofconduct.test.ts b/integration-test/tests/cms/codeofconduct.test.ts new file mode 100644 index 0000000..8162669 --- /dev/null +++ b/integration-test/tests/cms/codeofconduct.test.ts @@ -0,0 +1,12 @@ +import {expect, test} from '@playwright/test'; +import { codeofconductExepctedInformation } from '../../utils/datafactory/codeofconduct.data'; +test('GET /api/cms/v1/code-of-conduct returns correct data', async ({request}) => { + const response = await request.get(`/api/cms/v1/code-of-conduct`); + + expect(response.status()).toBe(200); + const body = await response.json(); + + const expectedResponse = codeofconductExepctedInformation; + + expect(body).toEqual(expectedResponse); + }); diff --git a/integration-test/utils/datafactory/codeofconduct.data.ts b/integration-test/utils/datafactory/codeofconduct.data.ts new file mode 100644 index 0000000..f1f6f91 --- /dev/null +++ b/integration-test/utils/datafactory/codeofconduct.data.ts @@ -0,0 +1,38 @@ +export const codeofconductExepctedInformation = { + "page": { + "title": "Code of Conduct", + "description": "At Women Coding Community we are committed to a vibrant, supportive community where women can network, share experiences, and foster professional relationships, regardless of age, gender, visible or invisible disability, ethnicity, gender expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, sexual orientation or preferred programming language(s)." + }, + "items": [ + { + "title": "Our Standards", + "description": "To ensure a positive experience for all members, we expect participants to exhibit the following behaviors:", + "items": [ + "Respect: Treat everyone with respect, dignity, and empathy. Listen and communicate thoughtfully.", + "Inclusivity: Actively seek to acknowledge and respect the diversity of our community.", + "Collaboration: Share knowledge generously and assist others when possible, fostering a collaborative atmosphere.", + "Constructive Communication: Engage in constructive, positive communication. Provide and gracefully accept constructive criticism.", + "Professionalism: Be professional in all interactions within the community. Avoid behavior or language that may be considered inappropriate or offensive." + ] + }, + { + "title": "Unacceptable Behavior", + "description": "The following behaviors are considered harassment and are unacceptable within our community:", + "items": [ + "Violence, threats of violence, or violent language directed against another member or group.", + "Sexist, racist, homophobic, transphobic, ableist, or otherwise discriminatory jokes and language.", + "Personal insults, particularly those related to gender, sexual orientation, race, religion, or disability.", + "Inappropriate photography or recording.", + "Advocating for, or encouraging, any of the above behavior." + ] + }, + { + "title": "Enforcement", + "description": "Community leaders are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful. Instances of abusive, harassing, or otherwise unacceptable behavior can be reported by email. All complaints will be reviewed and investigated promptly and fairly." + }, + { + "title": "Consequences", + "description": "Actions determined to be contrary to these guidelines may result in consequences ranging from a warning to expulsion from the community, future events depending on the severity of the behavior." + } + ] + }