Change slogan and refactor project info naming
The project's slagon has been updated back to "Privacy is sexy" from "Now you have the choice" for enhanced brand clarity and memorability. This change also reflects the community's preference and aligns with the project's established identity. This commit also refactors naming and structure of project information (metadata) struct to enhance clarity and maintainability in relation to changing the slogan. Key changes include: - Update UI components to display the revised slogan. - Remove period from project slogan in code area for consistency with a explanatory comment for future maintainability. - Refactor header container and class names for clarity. - Standardize project metadata usage in `TheCodeArea.vue` to ensure consistency. - Improve code clarity by renaming `IProjectInformation` to `ProjectDetails` and `ProjectInformation` to `GitHubProjectDetails`. - Organize `ProjectDetails` under a dedicated `Project` directory within the domain layer for better structure. These changes are expected to improve the project's appeal and streamline future maintenance and development efforts.
This commit is contained in:
@@ -2,7 +2,7 @@ import { describe, it, expect } from 'vitest';
|
||||
import { Application } from '@/domain/Application';
|
||||
import { OperatingSystem } from '@/domain/OperatingSystem';
|
||||
import { CategoryCollectionStub } from '@tests/unit/shared/Stubs/CategoryCollectionStub';
|
||||
import { ProjectInformationStub } from '@tests/unit/shared/Stubs/ProjectInformationStub';
|
||||
import { ProjectDetailsStub } from '@tests/unit/shared/Stubs/ProjectDetailsStub';
|
||||
import { ICategoryCollection } from '@/domain/ICategoryCollection';
|
||||
import { getAbsentCollectionTestCases } from '@tests/unit/shared/TestCases/AbsentTests';
|
||||
|
||||
@@ -12,10 +12,10 @@ describe('Application', () => {
|
||||
// arrange
|
||||
const missingOs = OperatingSystem.Android;
|
||||
const expectedError = `Operating system "${OperatingSystem[missingOs]}" is not defined in application`;
|
||||
const info = new ProjectInformationStub();
|
||||
const projectDetails = new ProjectDetailsStub();
|
||||
const collections = [new CategoryCollectionStub().withOs(OperatingSystem.Windows)];
|
||||
// act
|
||||
const sut = new Application(info, collections);
|
||||
const sut = new Application(projectDetails, collections);
|
||||
const act = () => sut.getCollection(missingOs);
|
||||
// assert
|
||||
expect(act).to.throw(expectedError);
|
||||
@@ -24,25 +24,25 @@ describe('Application', () => {
|
||||
// arrange
|
||||
const os = OperatingSystem.Windows;
|
||||
const expected = new CategoryCollectionStub().withOs(os);
|
||||
const info = new ProjectInformationStub();
|
||||
const projectDetails = new ProjectDetailsStub();
|
||||
const collections = [expected, new CategoryCollectionStub().withOs(OperatingSystem.Android)];
|
||||
// act
|
||||
const sut = new Application(info, collections);
|
||||
const sut = new Application(projectDetails, collections);
|
||||
const actual = sut.getCollection(os);
|
||||
// assert
|
||||
expect(actual).to.equals(expected);
|
||||
});
|
||||
});
|
||||
describe('ctor', () => {
|
||||
describe('info', () => {
|
||||
describe('projectDetails', () => {
|
||||
it('sets as expected', () => {
|
||||
// arrange
|
||||
const expected = new ProjectInformationStub();
|
||||
const expectedProjectDetails = new ProjectDetailsStub();
|
||||
const collections = [new CategoryCollectionStub()];
|
||||
// act
|
||||
const sut = new Application(expected, collections);
|
||||
const sut = new Application(expectedProjectDetails, collections);
|
||||
// assert
|
||||
expect(sut.info).to.equal(expected);
|
||||
expect(sut.projectDetails).to.equal(expectedProjectDetails);
|
||||
});
|
||||
});
|
||||
describe('collections', () => {
|
||||
@@ -75,10 +75,10 @@ describe('Application', () => {
|
||||
];
|
||||
for (const testCase of testCases) {
|
||||
it(testCase.name, () => {
|
||||
const info = new ProjectInformationStub();
|
||||
const projectDetails = new ProjectDetailsStub();
|
||||
const collections = testCase.value;
|
||||
// act
|
||||
const act = () => new Application(info, collections);
|
||||
const act = () => new Application(projectDetails, collections);
|
||||
// assert
|
||||
expect(act).to.throw(testCase.expectedError);
|
||||
});
|
||||
@@ -86,10 +86,10 @@ describe('Application', () => {
|
||||
});
|
||||
it('sets as expected', () => {
|
||||
// arrange
|
||||
const info = new ProjectInformationStub();
|
||||
const projectDetails = new ProjectDetailsStub();
|
||||
const expected = [new CategoryCollectionStub()];
|
||||
// act
|
||||
const sut = new Application(info, expected);
|
||||
const sut = new Application(projectDetails, expected);
|
||||
// assert
|
||||
expect(sut.collections).to.equal(expected);
|
||||
});
|
||||
@@ -99,10 +99,10 @@ describe('Application', () => {
|
||||
it('returns expected', () => {
|
||||
// arrange
|
||||
const expected = [OperatingSystem.Windows, OperatingSystem.macOS];
|
||||
const info = new ProjectInformationStub();
|
||||
const projectDetails = new ProjectDetailsStub();
|
||||
const collections = expected.map((os) => new CategoryCollectionStub().withOs(os));
|
||||
// act
|
||||
const sut = new Application(info, collections);
|
||||
const sut = new Application(projectDetails, collections);
|
||||
const actual = sut.getSupportedOsList();
|
||||
// assert
|
||||
expect(actual).to.deep.equal(expected);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { describe, it, expect } from 'vitest';
|
||||
import { ProjectInformation } from '@/domain/ProjectInformation';
|
||||
import { GitHubProjectDetails } from '@/domain/Project/GitHubProjectDetails';
|
||||
import { OperatingSystem } from '@/domain/OperatingSystem';
|
||||
import { EnumRangeTestRunner } from '@tests/unit/application/Common/EnumRangeTestRunner';
|
||||
import { VersionStub } from '@tests/unit/shared/Stubs/VersionStub';
|
||||
@@ -7,19 +7,19 @@ import { Version } from '@/domain/Version';
|
||||
import { PropertyKeys } from '@/TypeHelpers';
|
||||
import { SupportedOperatingSystem, AllSupportedOperatingSystems } from '@tests/shared/TestCases/SupportedOperatingSystems';
|
||||
|
||||
describe('ProjectInformation', () => {
|
||||
describe('GitHubProjectDetails', () => {
|
||||
describe('retrieval of property values', () => {
|
||||
interface IInformationParsingTestCase {
|
||||
interface PropertyTestScenario {
|
||||
readonly description?: string;
|
||||
readonly expectedValue: string;
|
||||
readonly buildWithExpectedValue: (
|
||||
builder: ProjectInformationBuilder,
|
||||
builder: ProjectDetailsBuilder,
|
||||
expected: string,
|
||||
) => ProjectInformationBuilder;
|
||||
readonly getActualValue: (sut: ProjectInformation) => string;
|
||||
) => ProjectDetailsBuilder;
|
||||
readonly getActualValue: (sut: GitHubProjectDetails) => string;
|
||||
}
|
||||
const propertyTestCases: {
|
||||
readonly [K in PropertyKeys<ProjectInformation>]: readonly IInformationParsingTestCase[];
|
||||
const propertyTestScenarios: {
|
||||
readonly [K in PropertyKeys<GitHubProjectDetails>]: readonly PropertyTestScenario[];
|
||||
} = {
|
||||
name: [{
|
||||
expectedValue: 'expected-app-name',
|
||||
@@ -100,13 +100,13 @@ describe('ProjectInformation', () => {
|
||||
getActualValue: (sut) => sut.releaseUrl,
|
||||
}],
|
||||
};
|
||||
Object.entries(propertyTestCases).forEach(([propertyName, testList]) => {
|
||||
Object.entries(propertyTestScenarios).forEach(([propertyName, testList]) => {
|
||||
testList.forEach(({
|
||||
description, buildWithExpectedValue, expectedValue, getActualValue,
|
||||
}) => {
|
||||
it(`${propertyName}${description ? ` (${description})` : ''}`, () => {
|
||||
// arrange
|
||||
const builder = new ProjectInformationBuilder();
|
||||
const builder = new ProjectDetailsBuilder();
|
||||
const sut = buildWithExpectedValue(builder, expectedValue).build();
|
||||
|
||||
// act
|
||||
@@ -144,7 +144,7 @@ describe('ProjectInformation', () => {
|
||||
it(`should return the expected download URL for ${OperatingSystem[operatingSystem]}`, () => {
|
||||
// arrange
|
||||
const { expected, version, repositoryUrl } = testScenarios[operatingSystem];
|
||||
const sut = new ProjectInformationBuilder()
|
||||
const sut = new ProjectDetailsBuilder()
|
||||
.withVersion(new VersionStub(version))
|
||||
.withRepositoryUrl(repositoryUrl)
|
||||
.build();
|
||||
@@ -156,7 +156,7 @@ describe('ProjectInformation', () => {
|
||||
});
|
||||
describe('should throw an error when provided with an invalid operating system', () => {
|
||||
// arrange
|
||||
const sut = new ProjectInformationBuilder()
|
||||
const sut = new ProjectDetailsBuilder()
|
||||
.build();
|
||||
// act
|
||||
const act = (os: OperatingSystem) => sut.getDownloadUrl(os);
|
||||
@@ -168,7 +168,7 @@ describe('ProjectInformation', () => {
|
||||
});
|
||||
});
|
||||
|
||||
class ProjectInformationBuilder {
|
||||
class ProjectDetailsBuilder {
|
||||
private name = 'default-name';
|
||||
|
||||
private version: Version = new VersionStub();
|
||||
@@ -179,33 +179,33 @@ class ProjectInformationBuilder {
|
||||
|
||||
private slogan = 'default-slogan';
|
||||
|
||||
public withName(name: string): ProjectInformationBuilder {
|
||||
public withName(name: string): this {
|
||||
this.name = name;
|
||||
return this;
|
||||
}
|
||||
|
||||
public withVersion(version: VersionStub): ProjectInformationBuilder {
|
||||
public withVersion(version: VersionStub): this {
|
||||
this.version = version;
|
||||
return this;
|
||||
}
|
||||
|
||||
public withSlogan(slogan: string): ProjectInformationBuilder {
|
||||
public withSlogan(slogan: string): this {
|
||||
this.slogan = slogan;
|
||||
return this;
|
||||
}
|
||||
|
||||
public withRepositoryUrl(repositoryUrl: string): ProjectInformationBuilder {
|
||||
public withRepositoryUrl(repositoryUrl: string): this {
|
||||
this.repositoryUrl = repositoryUrl;
|
||||
return this;
|
||||
}
|
||||
|
||||
public withHomepage(homepage: string): ProjectInformationBuilder {
|
||||
public withHomepage(homepage: string): this {
|
||||
this.homepage = homepage;
|
||||
return this;
|
||||
}
|
||||
|
||||
public build(): ProjectInformation {
|
||||
return new ProjectInformation(
|
||||
public build(): GitHubProjectDetails {
|
||||
return new GitHubProjectDetails(
|
||||
this.name,
|
||||
this.version,
|
||||
this.slogan,
|
||||
Reference in New Issue
Block a user